For reasons out of the scope of the question, I'm needing to dynamically create an instance of a child class that inherits from a base class, calling a constructor that doesn't exist with an argument passed to the base class constructor
Using example below: should create an instance of ExampleClass sending value to argument1 of BaseClass.
class BaseClass
{
public BaseClass()
{
}
public BaseClass(string argument1)
{
//...
}
}
class ExampleClass : BaseClass
{
public ExampleClass()
{
}
}
EDIT: I made another topic where I explain the source or my problem: Entity Framework DbContext dynamic instatiation with custom Connection String
public ExampleClass(string s) : base(s){}?public ExampleClass() : base(String.Empty) {}