public async Task <IActionResult> Edit(RequestsViewModel model) { if (model == null) { return(StatusCode(StatusCodes.Status400BadRequest)); } if (ModelState.IsValid) { await repository.EditRequest((Requests)modelMapper.Map(model, typeof(RequestsViewModel), typeof(Requests))); } return(RedirectToAction("Edit", model)); }