public T ToSingle(DataRow row) { EntityDescription description = EntityDescriptionCache.Get(typeof(T)); DataTable table = row.Table; return(GetSingle(row, description, table)); }
public List <T> ToList(DataTable table) { EntityDescription description = EntityDescriptionCache.Get(typeof(T)); List <T> list = new List <T>(Initializer.Instance.DefaultEntityListLen); foreach (DataRow row in table.Rows) { T instance = GetSingle(row, description, table); list.Add(instance); } return(list); }
public T ToSingle(DbDataReader reader) { if (reader.Read()) { EntityDescription description = EntityDescriptionCache.Get(typeof(T)); string[] names = DataExtensions.GetColumnNames(reader); return(GetSingle(reader, description, names)); } else { return(default(T)); } }
public List <T> ToList(DbDataReader reader) { EntityDescription description = EntityDescriptionCache.Get(typeof(T)); return(ToList(reader, description)); }