Given a generic class:
public class Foo<T>
{
public T Foo { get; set; }
public string Bar { get; set; }
}
Declared as:
var someVar = new Foo<string>();
Is there any way to tell if the type of Foo is defined as a generic T and not string?
I know you can check if the type of Foo is a string, but I want to determine if a member is defined by a generic parameter.
Aucun commentaire:
Enregistrer un commentaire