In Subsonic 2.1 how do I get type T from Find?
Animal criteria = new Animal();
IDataReader result = Animal.Find(criteria);
I want result to be of type Animal not IDataReader. How can I convert IDataReader to Animal? I hope there is a SubSonic or Framework method to do this for me.
Try this (from the Getting Started PDF Documentation):
IDataReader result = Animal.Find(criteria);
AnimalCollection coll = new AnimalCollection();
coll.Load(result);
result.Close();
// do something with coll
foreach (Animal anm in coll)
{
// do something with animal object
}