public ActionResult Create(CreateEditViewModel model) { var region = new Region(); Mapper.DynamicMap(model, region); regionProvider.AddRegion(region); var jsonViewModel = new AjaxViewModel(true, model, null); return(Json(jsonViewModel)); }
public ActionResult Create(CreateEditViewModel model) { var Region = new DataAccess.Region(); mapper.Map(model, Region); try { regionProvider.AddRegion(Region); } catch (Exception ex) { return(HandleException(ex)); } var jsonViewModel = new AjaxViewModel(true, model, null); return(Json(jsonViewModel)); }