//public int Count<T>(string connName) where T : Mappings.DataObject //{ // using (IConnectinContext cc = DBContext.GetConnection(type)) // { // return Count<T>(cc); // } //} public int Count <T>(IConnectinContext cc) where T : Mappings.DataObject { Type type = typeof(T); ObjectMapper om = ObjectMapper.GetOM(type); SelectDataReader sr = om.GetSelectReader(type); return(EntityBase.ExOnCount(cc, om.Table, this, sr.Group)); }
public object ListFirst(Type type, IConnectinContext cc, params string[] orderby) { ObjectMapper om = ObjectMapper.GetOM(type); SelectDataReader sr = om.GetSelectReader(type); string strob = null; if (orderby != null && orderby.Length > 0) { strob = string.Join(",", orderby); } return(EntityBase.ExOnListFirst(type, cc, om.GetSelectTable(sr), this, strob, sr.Group)); }
public RESULT ListFirst <T, RESULT>(IConnectinContext cc, params string[] orderby) where T : Mappings.DataObject, new() where RESULT : new() { Type type = typeof(T); ObjectMapper om = ObjectMapper.GetOM(typeof(T)); SelectDataReader sr = om.GetSelectReader(typeof(RESULT)); string strob = null; if (orderby != null && orderby.Length > 0) { strob = string.Join(",", orderby); } return((RESULT)EntityBase.ExOnListFirst(typeof(RESULT), cc, om.GetSelectTable(sr), this, strob, sr.Group)); }