Esempio n. 1
0
        public void Handle(CommitSeatReservation command)
        {
            var availability = repository.Get(command.ConferenceId);

            availability.CommitReservation(command.ReservationId);
            repository.Save(availability, command.Id.ToString());
        }
Esempio n. 2
0
        public void Handle(CommitSeatReservation command)
        {
            var repo = this.repositoryFactory();

            using (repo as IDisposable)
            {
                var availability = repo.Find <SeatsAvailability>(command.ConferenceId);
                if (availability != null)
                {
                    availability.CommitReservation(command.ReservationId);
                    repo.Save(availability);
                }
                // TODO: what if there's no aggregate? how do we tell the saga?
            }
        }
Esempio n. 3
0
        public async Task HandleAsync(ICommandContext context, CommitSeatReservation command)
        {
            var conference = await context.GetAsync <Conference>(command.AggregateRootId);

            conference.CommitReservation(command.ReservationId);
        }
 public void Handle(ICommandContext context, CommitSeatReservation command)
 {
     context.Get <Conference>(command.AggregateRootId).CommitReservation(command.ReservationId);
 }