ASP.NET Core is using non-default constructor if no public default constructor found
问题 I am writing ASP.NET Core 2.2.0 application hosted on Service Fabric. I have a class which represents a request and I have declared two constructors: public for my own usage and private for serializers: public class MyClass { private MyClass() // for serializer { } public MyClass(string myProperty) // for myself { MyProperty = myProperty ?? throw new ArgumentNullException(nameof(myProperty)); } [Required] public string MyProperty { get; private set; } } Then, I created an API controller: