public void Handle(CancelSeatReservation command) { var availability = repository.Get(command.ConferenceId); availability.CancelReservation(command.ReservationId); repository.Save(availability, command.Id.ToString()); }
public void Handle(CancelSeatReservation command) { var repo = this.repositoryFactory(); using (repo as IDisposable) { var availability = repo.Find <SeatsAvailability>(command.ConferenceId); if (availability != null) { availability.CancelReservation(command.ReservationId); repo.Save(availability); } // TODO: what if there's no aggregate? how do we tell the saga? } }
public async Task HandleAsync(ICommandContext context, CancelSeatReservation command) { var conference = await context.GetAsync <Conference>(command.AggregateRootId); conference.CancelReservation(command.ReservationId); }
public void Handle(ICommandContext context, CancelSeatReservation command) { context.Get <Conference>(command.AggregateRootId).CancelReservation(command.ReservationId); }