This for C#? Passing Class type as a parameter
I have a class adapter that implements an Interface. I want to fill an array structure with MyFooClass instances where M
I think you want generics.
Declare your method like this:
public void FillWsvcStructs(DataSet ds)
where T : IElemRequest, new()
{
//You can then do
IElemRequest req = new T();
}
The new() constraint requires T
to have a public parameterless constructor, and the IElemRequest
constraint ensures it implements IElemRequest
.