Exemple #1
0
        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());
            }
        }
Exemple #2
0
        public async Task HandleAsync(ICommandContext context, RemoveSeatType command)
        {
            var conference = await context.GetAsync <Conference>(command.AggregateRootId);

            conference.RemoveSeat(command.SeatTypeId);
        }
        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 void Handle(ICommandContext context, RemoveSeatType command)
 {
     context.Get <Conference>(command.AggregateRootId).RemoveSeat(command.SeatTypeId);
 }