Hi, I have a method which calls my service factory:
class person
{
public int ID { get; set: }
public string Name {get; set;}
}
IList<Personmyp eople = __serviceFactor y.Fetch(new Person())
Here is my generic method:
public List<TFetch<T>( T fetchobject)
{
Type __type = fetchobject.Get Type();
// return a generic list of all of the people
IList<__typemyP eopleList = new IList<__type>() ;
myPeopleList = DataLayer.GetMy People(); // will return a
IList<Person>
return myPeopleList
}
I am getting an error when I try to cast the IList<typebecau se I
don't think you can do that. Is there a way I can pass in a generic
object and create a generic collection from a generic object?