Пример #1
0
        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()));
            }
        }
Пример #2
0
        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()));
            }
        }
Пример #3
0
        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()));
            }
        }