Пример #1
0
        public GetMagazineViewModel Delete(long id)
        {
            var magazine = _magazineRepository.Get(id);

            if (magazine == null)
            {
                throw new BusinessLogicException("Magazine not found");
            }

            var result = new GetMagazineViewModel()
            {
                Id                = magazine.Id,
                Name              = magazine.Name,
                Number            = magazine.Number,
                YearOfPublication = magazine.YearOfPublication
            };

            _magazineRepository.Delete(id);
            return(result);
        }
Пример #2
0
 public async Task Delete(int id)
 {
     await _magazineRepository.Delete(id);
 }