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; }
public override void Handle(CountryEvents.NameChanged message) { CountryDto dto = this.Load(message.CountryId); dto.Name = message.Name; this.Save(dto); }