Ejemplo n.º 1
0
        private T Get <T>(DbCtx db, Expression <Func <T, bool> > where, params Expression <Func <T, object> >[] navigationProperties) where T : class
        {
            IQueryable <T> query = db.GetQuery <T>(where, navigationProperties);

            return(query.FirstOrDefault());
        }
Ejemplo n.º 2
0
        private IList <T> GetList <T>(DbCtx db, Expression <Func <T, bool> > where, params Expression <Func <T, object> >[] navigationProperties) where T : class
        {
            IQueryable <T> query = db.GetQuery <T>(where, navigationProperties);

            return(query.ToList <T>());
        }
Ejemplo n.º 3
0
        private IList <T> GetPaginated <T>(DbCtx db, int page, int limit, Expression <Func <T, bool> > where, params Expression <Func <T, object> >[] navigationProperties) where T : class
        {
            IQueryable <T> query = db.GetQuery <T>(where, navigationProperties);

            return(query.Skip(page * limit).Take(limit).ToList <T>());
        }