예제 #1
0
        public ActionResult Create(CustomerReadModel customer)
        {
            customer.CustomerId = Guid.NewGuid();

            var command = new CreateNewCustomerCommand
            {
                CustomerId = customer.CustomerId,
                FirstName = customer.FirstName,
                LastName = customer.LastName,
                Address = customer.Address,
                PostCode = customer.PostCode
            };
            Bus.Send(command);

            return View("ConfirmCreate", customer);
        }
예제 #2
0
        public ActionResult Edit(CustomerReadModel customer)
        {
            CustomerReadModel customerToUpdate = context.Customers.
                Where(c => c.CustomerId == customer.CustomerId).
                FirstOrDefault();

            var command = new UpdateCustomerAddressCommand
            {
                CustomerId = customer.CustomerId,
                Address = customer.Address,
                PostCode = customer.PostCode
            };
            Bus.Send(command);

            return View("ConfirmEdit", customer);
        }