Пример #1
0
        public Task <TEntity> GetByIdWithDeletedAsync(params object[] id)
        {
            var getByIdPredicate = EfExpressionHelper
                                   .BuildByIdPredicate <TEntity>(this.Context, id);

            return(this.AllWithDeleted()
                   .FirstOrDefaultAsync(getByIdPredicate));
        }
        public Task <TEntity> GetByIdWithoutDeletedAsync(string userId, params object[] id)
        {
            var getByIdPredicate = EfExpressionHelper.BuildByIdPredicate <TEntity>(this.Context, id);

            return(this.All()
                   .Where(x => x
                          .UserId.Equals(userId))
                   .FirstOrDefaultAsync(getByIdPredicate));
        }
Пример #3
0
        public virtual IQueryable <TEntity> GetByIdQueryable(params object[] id)
        {
            var byIdPredicate = EfExpressionHelper.BuildByIdPredicate <TEntity>(this.Context, id);

            return(this.All().Where(byIdPredicate));
        }