예제 #1
0
 public ICollection <ClientDto> All()
 {
     return(entityQuery
            .Query <Client>()
            .Select(ClientToDtoMapping)
            .ToList());
 }
        public static async Task <BudgetClass> FindDuplicateByNameAsync(this IEntityQuery <BudgetClass> repository, BudgetClass entity)
        {
            IQueryable <BudgetClass> query = repository.Query(bc => bc.Name == entity.Name.Trim());

            if (entity.Id != 0)
            {
                query = query.Where(bc => bc.Id != entity.Id);
            }

            return(await query.FirstOrDefaultAsync());
        }
 public static IIncludableQueryable <TEntity, TProperty> Include <TEntity, TProperty>(
     this IEntityQuery <TEntity> repository,
     Expression <Func <TEntity, TProperty> > navigationPropertyPath) where TEntity : class
 {
     return(repository.Query().Include(navigationPropertyPath));
 }
 public static async Task <TEntity> FirstOrDefaultAsync <TEntity>(
     this IEntityQuery <TEntity> repository,
     Expression <Func <TEntity, bool> > where) where TEntity : class
 {
     return(await repository.Query(where).FirstOrDefaultAsync());
 }
 public static async Task <TEntity> FirstOrDefaultAsync <TEntity>(
     this IEntityQuery <TEntity> repository) where TEntity : class
 {
     return(await repository.Query().FirstOrDefaultAsync());
 }
예제 #6
0
 public RowSet Query(IQuery query)
 {
     CheckDisposed();
     return(new RowSet(_qry.Query(query)));
 }
예제 #7
0
        public static IQueryable <T> Query <T>(this IEntityQuery entityQuery, params Expression <Func <T, object> >[] includes) where T : class, IEntity
        {
            var convertedIncludes = includes.Select(i => i.Body).MemberPaths().Where(i => !string.IsNullOrEmpty(i)).ToArray();

            return(entityQuery.Query <T>(convertedIncludes));
        }
예제 #8
0
 public static IEnumerable <T> Query <T>(this IEntityQuery entityQuery, Expression <Func <T, bool> > whereCondition, params Expression <Func <T, object> >[] includes) where T : class, IEntity
 {
     return(entityQuery.Query <T>(includes).Where(whereCondition).ToList().AsEnumerable());
 }