public override IQueryable <PostDTO> Query()
        {
            var query = Context.Set <Post>().Where(item => item.UserId == _userId).ProjectTo <PostDTO>(_config);

            query = TableUtils.ApplyDeletedFilter(query, IncludeDeleted);
            return(query);
        }
        public override IQueryable <TData> Query()
        {
            IQueryable <TData> query = this.Context.Set <TModel>().Project().To <TData>();

            query = TableUtils.ApplyDeletedFilter(query, this.IncludeDeleted);
            return(query);
        }
Exemple #3
0
        public override IQueryable <TData> Query()
        {
            var query = Context.Set <TModel>().ProjectTo <TData>(_config);

            query = TableUtils.ApplyDeletedFilter(query, IncludeDeleted);
            return(query);
        }
        public override IQueryable <PostDTO> Query()
        {
            var query =
                Context.Set <Post>()
                .Where(item => item.Status == PhotoStatus.Running && item.Votes.Count(v => v.UserId == _userId) > 0)
                .OrderBy(o => o.CreatedAt)
                .ProjectTo <PostDTO>(_config);

            query = TableUtils.ApplyDeletedFilter(query, IncludeDeleted);
            return(query);
        }
Exemple #5
0
        public override SingleResult <TData> Lookup(string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            var query = Context.Set <TModel>().Where(item => item.Id == id).ProjectTo <TData>(_config);

            query = TableUtils.ApplyDeletedFilter(query, IncludeDeleted);
            return(SingleResult.Create(query));
        }
Exemple #6
0
        private SingleResult <TData> Lookup(string id, bool includeDeleted)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            IQueryable <TData> query = this.Context.Set <TData>().Where(item => item.Id == id);

            query = TableUtils.ApplyDeletedFilter(query, includeDeleted);
            return(SingleResult.Create(query));
        }
        protected virtual SingleResult <TData> LookupEntity(Expression <Func <TModel, bool> > filter, bool includeDeleted)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            IQueryable <TData> query = this.Context.Set <TModel>().Where(filter).Project().To <TData>();

            query = TableUtils.ApplyDeletedFilter(query, includeDeleted);
            return(SingleResult.Create(query));
        }
Exemple #8
0
        public override IQueryable <TData> Query()
        {
            IQueryable <TData> query = this.Context.Set <TData>();

            return(TableUtils.ApplyDeletedFilter(query, this.IncludeDeleted));
        }