public SetActiveStatusRequestValidator(DomainRepository repository)
        {
            _repository = repository;

            RuleFor(x => x)
            .Must(x => NotAny(_repository, QueryPredicates.ChangedStatus <TEntity>(x.Id, x.IsActive)))
            .WithError(ValidationCodes.Common.Cmn044, values: typeof(TEntity).Name);
        }
Exemplo n.º 2
0
        public IQueryable <T> Filter(IQueryable <T> query)
        {
            if (string.IsNullOrEmpty(_keyword))
            {
                return(query);
            }

            return(query.Where(QueryPredicates.EmailFilterPredicate <T>(_keyword)));
        }