Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public static ProducerDTO From(Producer producer)
 {
     var dto = new ProducerDTO();
     dto.Name = producer.Name;
     return dto;
 }