public EditArtistResponse EditArtist(EditArtistRequest request) { var response = new EditArtistResponse(); var artist = _artistRepository.FindBy(request.Id); artist.Name = request.Name; ThrowExceptionIfArtistIsInvalid(artist); _artistRepository.Save(artist); _uow.Commit(); response.Artist = artist.ConvertToArtistView(); return response; }
public ActionResult Edit(EditArtistViewModel model) { if (!ModelState.IsValid) { return View(model); } var request = new EditArtistRequest { Id = model.Id, Name = model.Name }; _artistService.EditArtist(request); return RedirectToAction("Index"); }