I would like to add a generic type method DoSomething<T>, but for backward compatibility I want it to simply pass the type parameter for the generic type from an existing method with the same name.
public void DoSomething<T>(Data data)
{
}
public void DoSomething(Data data, Type dataType)
{
DoSomething<dataType>(group);
}
However <dataType>, the new one DoSomethingproduces the following type-checking error: "Preferred type name or namespace."
Can someone help me understand the gap in my thinking that makes the above pattern an error of type checking? Is that what I'm doing ... bad design?
source
share