Beispiel #1
0
 public static BottleDTO From(Bottle bottle)
 {
     var dto = new BottleDTO();
     dto.Guid = bottle.Guid;
     dto.Wine = WineDTO.From(bottle.Wine);
     dto.Year = bottle.Year;
     dto.Price = bottle.Price;
     dto.AddedAt = bottle.AddedAt;
     return dto;
 }
Beispiel #2
0
 public void Open(BottleDTO bottle)
 {
     ExecutionContext.Instance.Execute(new OpenBottle(bottle.To()));
 }
Beispiel #3
0
 public IEnumerable<ErrorMessage> Validate(BottleDTO bottle)
 {
     var entity = bottle.To();
     var validator = new ValidateBottle(entity.Wine.ToMaybe(), entity.Year, entity.Price);
     return validator.Errors;
 }
Beispiel #4
0
 public void Create(BottleDTO bottle)
 {
     var entity = bottle.To();
     ExecutionContext.Instance.Execute(new CreateBottle(entity));
 }