public virtual int GetCount(SafeDeletableState state, Expression <Func <TEntity, bool> > condition)
        {
            var data = GetQueryable(state);

            return(GetCountInternal(data, condition));
        }
        public virtual IList <TEntity> GetAll(SafeDeletableState state, Expression <Func <TEntity, bool> > condition, Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > sortFunc)
        {
            var data = GetQueryable(state);

            return(GetAllInternal(data, condition, sortFunc, null));
        }
 public virtual int GetCount(SafeDeletableState state)
 {
     return(GetCount(state, null));
 }
 public virtual IList <TEntity> GetAll(SafeDeletableState state, Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > sortFunc)
 {
     return(GetAll(state, null, sortFunc));
 }
 public virtual IList <TEntity> GetAll(SafeDeletableState state, Expression <Func <TEntity, bool> > condition)
 {
     return(GetAll(state, condition, null));
 }
 public virtual IList <TEntity> GetAll(SafeDeletableState state)
 {
     return(GetAll(state, null, null));
 }
        protected virtual IQueryable <TEntity> FilterByState(IQueryable <TEntity> data, SafeDeletableState state)
        {
            IQueryable <TEntity> result = data;

            switch (state)
            {
            case SafeDeletableState.Deleted:
                result = data.Where(DeletedCondition);
                break;

            case SafeDeletableState.NotDeleted:
                result = data.Where(NotDeletedCondition);
                break;
            }
            return(result);
        }
 public virtual IQueryable <TEntity> GetQueryable(SafeDeletableState state)
 {
     return(FilterByState(DbSet, state));
 }
        public virtual IList <TEntity> GetWindow(SafeDeletableState state, Expression <Func <TEntity, bool> > condition, int startFrom, int windowSize, Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > sortFunc)
        {
            var data = GetQueryable(state);

            return(GetWindowInternal(data, condition, startFrom, windowSize, sortFunc));
        }
 public virtual IList <TEntity> GetWindow(SafeDeletableState state, int startFrom, int windowSize, Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > sortFunc)
 {
     return(GetWindow(state, null, startFrom, windowSize, sortFunc));
 }