public async Task <ActionResult> Create(HelloWorldViewModel model) { if (!ModelState.IsValid) { return(View(model)); } await _service.CreateAsync(Mapper.Map <HelloWorldModel>(model)); return(RedirectToAction(nameof(HelloWorldController.Index))); }
public async Task Post(HelloWorldViewModel model) { var mappedModel = Mapper.Map <HelloWorldModel>(model); await _helloWorldService.CreateAsync(mappedModel); }