Ejemplo n.º 1
0
        public void Update(UpdateMagazineViewModel magazineViewModel)
        {
            if (_magazineRepository.Get(magazineViewModel.Id) == null)
            {
                throw new BusinessLogicException("Magazine not found");
            }

            var magazine = new Magazine()
            {
                Id                = magazineViewModel.Id,
                Name              = magazineViewModel.Name,
                Number            = magazineViewModel.Number,
                YearOfPublication = magazineViewModel.YearOfPublication
            };

            _magazineRepository.Update(magazine);
        }
Ejemplo n.º 2
0
 public async Task Update(UpdateMagazineView updateMagazine)
 {
     await _magazineRepository.Update(new Magazine { Id = updateMagazine.Id, Title = updateMagazine.Title, Price = updateMagazine.Price });
 }