public RESULT Avg <RESULT, Entity>(string field, bool DISTINCT, IConnectinContext cc) where Entity : Mappings.DataObject { ObjectMapper om = ObjectMapper.GetOM(typeof(Entity)); object value = EntityBase.ExOnAggregation(cc, om.Table, "Avg", field, DISTINCT, this, null); if (value == null || value == DBNull.Value) { return(default(RESULT)); } return((RESULT)Convert.ChangeType(value, typeof(RESULT))); }
public int Count <T>(string field, bool DISTINCT, IConnectinContext cc) where T : Mappings.DataObject { ObjectMapper om = ObjectMapper.GetOM(typeof(T)); object value = EntityBase.ExOnAggregation(cc, om.Table, "count", field, DISTINCT, this, null); if (value == null || value == DBNull.Value) { return(0); } return((int)Convert.ChangeType(value, typeof(int))); }