public ActionResult Create(Order order) { if (ModelState.IsValid) { order.SubmittedAt = DateTime.UtcNow; Database.Orders.Add(order.OrderId, order); // we could also leverage DI, but hey it is a demo app... MvcApplication.Bus.Send<OrderFacility>(m => { m.OrderId = order.OrderId; m.CategoryId = order.CategoryId; }); return RedirectToAction("Index"); } return View(order); }
public ActionResult Create() { var order = new Order { CategoryId = new Guid("{400FA2D8-2B33-4C2C-8369-1C75B736DF4A}") }; return View(order); }