You can try similar to this
First of all add similar method in inside Entity Class
public EntityClass Fill(IDataReader row)
{
return new EntityClass(row);
}
private GenericList<t> ConvertTo<t>(IDataReader reader)
where T : EntityClass, new()
{
GenericList<t> temp = new GenericList<t>();
try
{
while (reader.Read())
{
temp.Add((new T().Fill(reader)) as T);
}
return temp;
}
catch (Exception ex)
{
throw ex;
}
finally
{
reader.Close();
}
}
</t></t></t></t>
then you can invoke the business layer method from UI inturn invoke data access layer. DAL will return the data reader instance. This instance you can pass to ConverTo method to get the generic list. Hope this will give an hint
Thanks
Nilesh