public IActionResult Save(ExampleEntitySaveEditViewModel data) { var dto = _mapper.Map <ExampleEntitySaveEditViewModel, ExampleEntitySaveEditDto>(data); var resultDto = _exampleEntityService.Save(dto); var resultViewModel = _mapper.Map <ExampleEntitySaveEditDto, ExampleEntitySaveEditViewModel>(resultDto); if (!resultDto.IsValid()) { SetErros(resultDto.ValidationErros); return(View(resultViewModel)); } return(RedirectToAction("Index")); }
public IActionResult Save() { var resultViewModel = new ExampleEntitySaveEditViewModel(); return(View(resultViewModel)); }