I have a General Class named MyGeneralClass:
public MyGeneralClass<T> {
public List<T> Data {get; set;}
}
also I have another method that I need to use it:
public void GetData(Type type) {
}
I Use GetDatalike this:
GetData(typeof(MyGeneralClass<person>));
So my question is that how can I find type of T, (in this example person) in GetData method, I can’t change the parameters of GetData but I can change implementation of that. Does any one have any idea about this?
Via reflection: