Esempio n. 1
0
        public IEnumerable Handle(Func <Guid, TournamentAggregate> al, SaveGuestPackages command)
        {
            var tournament = CommandQueries.GetTournaments().FirstOrDefault(x => x.Year == command.Year);
            var agg        = al(tournament.Id);

            foreach (var guestpackage in command.GuestPackages)
            {
                yield return(new GuestPackageSaved
                {
                    Id = tournament.Id,
                    Code = guestpackage.Code,
                    Name = guestpackage.Name,
                    Cost = guestpackage.Cost,
                    Enabled = guestpackage.Enabled
                });
            }
        }
 public JsonResult Save(SaveGuestPackages command)
 {
     command.Id = Guid.NewGuid();
     Domain.Dispatcher.SendCommand(command);
     return(Json(command));
 }