Exemplo n.º 1
0
        public virtual T Get(EventQueryOptions <T> options)
        {
            IQueryable <T> query = dbset;

            foreach (string include in options.getIncludes())
            {
                query = query.Include(include);
            }
            if (options.HasWhere)
            {
                query = query.Where(options.Where);
            }
            return(query.FirstOrDefault());
        }
Exemplo n.º 2
0
        public virtual IEnumerable <T> List(EventQueryOptions <T> options)
        {
            IQueryable <T> query = dbset;

            foreach (string include in options.getIncludes())
            {
                query = query.Include(include);
            }
            if (options.HasWhere)
            {
                query = query.Where(options.Where);
            }
            if (options.HasOrderBy)
            {
                query = query.OrderBy(options.OrderBy);
            }
            return(query.ToList());
        }