public T Single(Action <SqlExp <T> > expression) { using (var conn = DbConnFactory.Open(DbName)) { var exp = SqlExp <T> .GetSqlExp(conn); expression(exp); return(conn.Single(exp.GetExp())); } }
public IEnumerable <T> Where(Action <SqlExp <T> > expression) { using (var conn = DbConnFactory.Open(DbName)) { var exp = SqlExp <T> .GetSqlExp(conn); expression(exp); return(conn.Select(exp.GetExp())); } }
public int Count(Action <SqlExp <T> > expression) { using (var conn = DbConnFactory.Open(DbName)) { var exp = SqlExp <T> .GetSqlExp(conn); expression(exp); return((int)conn.Count <T>(exp.GetExp())); } }