예제 #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));
        }