protected bool NotAny <T>(DomainRepository repository, Expression <Func <T, bool> > predicate, IQueryInclude <T> queryInclude = null) where T : AuditableEntity, new() { var query = new CheckPredicateQuery <T>(true) { ContextRequest = new ContextRequest <EmptyRequest>(UserContext), Predicate = predicate, QueryInclude = queryInclude }; var queryResult = repository.ExecuteQuery(query); return(queryResult.Status == HttpStatusCode.OK && queryResult.Value); }
public Response <T> Get <T>(IdRequest request, GetQuery <T, IdRequest> query) where T : class, IEntity { var response = new Response <T>(); if (request.IsRequestInvalid(response, ContextInfo)) { return(response); } query.ContextRequest = WrapRequest(request); var result = Repository.ExecuteQuery(query); response.Merge(result); return(response); }