public async Task DeleteSeat(Guid id) { var command = new RemoveSeatType(this._conference.Id) { SeatTypeId = id }; var result = await ExecuteCommandAsync(command); if (!result.IsSuccess()) { throw new InvalidOperationException(result.GetErrorMessage()); } }
public async Task HandleAsync(ICommandContext context, RemoveSeatType command) { var conference = await context.GetAsync <Conference>(command.AggregateRootId); conference.RemoveSeat(command.SeatTypeId); }
public void Handle(ICommandContext context, RemoveSeatType command) { context.Get <Conference>(command.AggregateRootId).RemoveSeat(command.SeatTypeId); }