public IEnumerable<ErrorMessage> Validate(ProducerDTO producer)
 {
     var entity = producer.To();
     var validator = new ValidateProducer(entity.Name);
     var uniqueness = new UniquenessConstraint<Producer>(() => validator.Commit());
     return validator.Errors.Union(uniqueness.Errors);
 }
Exemple #2
0
 public static ProducerDTO From(Producer producer)
 {
     var dto = new ProducerDTO();
     dto.Name = producer.Name;
     return dto;
 }