public async Task Move(MoveCustomer command) { if (command.AggregateId != Id) { throw new InvalidOperationException("The command was not sended to this aggregate root."); } await RaiseEventAsync(new CustomerMoved(Id, command.Address, command)); }
public CustomerMoved(string aggregateId, string address, MoveCustomer previous) : base(typeof(Customer).Name, aggregateId, 0, previous) { Id = aggregateId; Address = address; }