Пример #1
0
        public IActionResult Edit(EditArtistViewModel viewModel)
        {
            if (!ModelState.IsValid)
                return View();

            artistRepository.EditArtist(viewModel);

            return RedirectToAction("index");
        }
Пример #2
0
        public void EditArtist(EditArtistViewModel model)
        {
            var artist = new Artist
            {
                Id = model.Id,
                Name = model.Name,
                EMail = model.Email,
                Revenue = model.Revenue,
                Description = model.Description
            };

            context.Artists.Update(artist);
            context.SaveChanges();
        }