public ActionResult Create(CreateEditViewModel model) { var unit = new DataAccess.Unit(); mapper.Map(model, unit); try { unitProvider.AddUnit(unit); } catch (Exception ex) { return(HandleException(ex)); } var jsonViewModel = new AjaxViewModel(true, model, null); return(Json(jsonViewModel)); }