protected virtual object ReaderBinder SqlCommand cmd var list new List

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
protected virtual object ReaderBinder(SqlCommand cmd)
{
var list = new List<IDomain>();
SqlDataReader reader = cmd.ExecuteReader();
if (reader == null)
{
return null;
}
while (reader.Read())
{
IDomain p = BindRecord(reader);
SetId((IDomainSetter) p, GetIdForRecord(reader));
list.Add(p);
}
return list;
}