private int ReadCount(DbQuery query) { return(Read(query, reader => reader.Read() ? SqlTools.ReadInt32(reader, ALL_COUNT_FIELD) : 0)); }
protected bool Exists <T>(QueryCondition conditions) where T : new() { var q = Orm.Orm.CountSelect <T>(conditions, ALL_COUNT_FIELD); return(Read(q, reader => reader.Read() && SqlTools.ReadInt32(reader, ALL_COUNT_FIELD) > 0)); }
protected bool Exists(DbQuery query, string resName = ALL_COUNT_FIELD) { var q = Orm.Orm.CountSelect(query, resName); return(Read(q, reader => reader.Read() && SqlTools.ReadInt32(reader, resName) > 0)); }