コード例 #1
0
 public ISpecification<Person> BuildSpecificationFromQuery(PersonQuery query)
 {
     var leftSpec = GetNameAndJobSpecification(query.NameLogic, query.NameFragment, query.JobFragment);
     var rightSpec = GetAgeSpecifications(query.MinAgeLogic, query.MinAge, query.MaxAge);
     return getSpecificationByLogic(query.JobLogic, leftSpec, rightSpec);
 }
コード例 #2
0
 public virtual IEnumerable<Person> Search(PersonQuery query)
 {
     ISpecification<Person> personSpecification = _specificationBuilder.BuildSpecificationFromQuery(query);
     return _repository.GetBySpecification(personSpecification);
 }