Ejemplo n.º 1
0
 public override void Handle(CountryEvents.Created message)
 {
     CountryDto dto = this.Load(message.CountryId);
     if (dto != null) throw new Exception("Item with the same Id already created!");
     dto = new CountryDto();
     dto.CountryId = message.CountryId;
     this.Save(dto);
 }
 public void When(CountryEvents.NameChanged e)
 {
     this.Name = e.Name;
 }
 public void When(CountryEvents.Created e)
 {
     this.CountryId = e.CountryId;
 }
Ejemplo n.º 4
0
 public override void Handle(CountryEvents.NameChanged message)
 {
     CountryDto dto = this.Load(message.CountryId);
     dto.Name = message.Name;
     this.Save(dto);
 }