public ActionResult Test(ApartmentViewModel app) { try { //Mapper.Initialize(cfg => cfg.CreateMap<ApartmentViewModel, ApartmentDTO>()); var appDto = Mapper.Map <ApartmentViewModel, ApartmentDTO>(app); apartmentService.AddApartament(appDto); return(Content("<h2>Ваш заказ успешно оформлен</h2>")); } catch (ValidationException ex) { ModelState.AddModelError(ex.Property, ex.Message); } return(View(app)); }