I have the following static class
public static class MyFoo<T> where T : class
{
public static IBar<T> Begin()
{
return new Bar<T>();
}
}
Elsewhere, I have a variable of System.Type, which I need to pass in as the Generic Type argument, ideally:
public void MyFunction(Type type)
{
MyFoo<type>.Begin();
}
I know its possible through reflection to return an instance of MyFoo (If i make it non static) but this would not be ideal. Is there anyway to pass type as a Generic Type argument to the MyFoo static class?