How can I instantiate the type T inside my InstantiateType method below?
InstantiateType
I\'m getting the error: \'T\' is a \'type parameter\' but is u
Declare your method like this:
public string InstantiateType(string firstName, string lastName) where T : IPerson, new()
Notice the additional constraint at the end. Then create a new instance in the method body:
new
T obj = new T();