public ActionResult Create(CustomerFormModel form)
{
if (ModelState.IsValid)
{
//maps to domain object from view model
var command = Mapper.Map<CustomerFormModel,
NewCustomerCommand>(form);
var message = new BrokeredMessage(command);
// Send customer message to Service Bus Queue
ServiceBusQueueHelper.CustomersQueueClient.Send(message);
return RedirectToAction("Index");
}
return View(form);
}