public IActionResult Update(Actor actor) { if (!ModelState.IsValid) { return(View(actor)); } _actorRepository.Update(actor); return(RedirectToAction("List")); }
public async Task <IActionResult> Update([FromForm] ActorUpdateModel actorModel) { var model = await _actorRepo.GetActor(actorModel.Id); if (model == null) { return(NotFound()); } var actor = new Actor { Id = actorModel.Id, ActorName = actorModel.ActorName, ActorPicture = actorModel.ActorPicture }; await _actorRepo.Update(actor); return(Ok(actor)); }