Esempio n. 1
0
        public ActionResult Create(Dinner dinner)
        {
            if (ModelState.IsValid)
            {
                var command = new HostDinner(new DinnerId(dinner.DinnerID), User.Identity.Name, dinner.Title, dinner.EventDate, dinner.Description, dinner.ContactPhone, dinner.Address, dinner.Country);
                new HostDinnerApplicationService(db).When(command);

                return RedirectToAction("Index");
            }

            return View(dinner);
        }
Esempio n. 2
0
        public ActionResult Create(Dinner dinner)
        {
            if (ModelState.IsValid)
            {
                var command = new HostDinner(new DinnerId(Guid.NewGuid()), User.Identity.Name, dinner.Title, dinner.EventDate, dinner.Description, dinner.ContactPhone, dinner.Address, dinner.Country);
                //new HostDinnerApplicationService(Globals.Repository).When(command);
                Globals.Bus.Send(command);

                return RedirectToAction("Index");
            }

            return View(dinner);
        }