void RegisterFranchiseTaxId(string taxId) { if (string.IsNullOrEmpty(this.Entity.TaxId)) { var @event = new FranchiseTaxIdRegistered(this.Entity.ID, taxId); this.Entity.Apply(@event); } else { throw new InvalidOperationException("Cannot change a businesses TaxId without change of ownership first."); } }
public void Apply(FranchiseTaxIdRegistered @event) { this.TaxId = @event.TaxId; }