My question is, if I do not have a default constructor in Class A(which is a base class and has other 2 or 3 constructors different from the standard one), how could I run a constructor different from the standard one Class Bthat I got from Class A.
But I saw that this does not apply to the default C # classes, I worked with value providers in asp.net mvc and came across a class called FormValueProviderthat was derived from its base class NameValueCollectionValueProvider.
FormValueProviderhas only one constructor that has a parameter of type ControllerContext. And the base class NameValueCollectionValueProviderhas two constructors, one with two type parameters NameValueCollectionand, CultureInforespectively, and the other with three parameters, two of which are a type NameValueCollection, and the third is a typeCultureInfo.
How can I instantiate a class with its only parameterized constructor when it
does not have a default constructor. Why does this rule exist for a programmer who writes his own code, not applicable to standard C # classes written by Microsoft. FormValueProvider NameValueCollectionValueProvider
source
share