public void Put(PutMagazineView magazine) { Magazine magazineModel = _magazineRepository.Get(magazine.Id); magazineModel.Name = magazine.Name; magazineModel.Number = magazine.Number; magazineModel.YearOfPublishing = magazine.YearOfPublishing; _magazineRepository.Update(magazineModel); }
public MagazineViewModel Get(int id) { Magazine magazine = _magazineRepository.Get(id); var result = Mapper.Map <Magazine, MagazineViewModel>(magazine); return(result); }
public MagazineService() { _applicationContext = new ApplicationContext(); _magazineRepository = new MagazineRepository(_applicationContext); _publishingHouseRepository = new PublishingHouseRepository(_applicationContext); _publicationInPublisihngHouseRepository = new PublicationInPublisihngHouseRepository(_applicationContext); _publicationRepository = new PublicationRepository(_applicationContext); _publicationInPublisihngHouses = _publicationInPublisihngHouseRepository.Get(/*includeProperties: "PublishingHouse, Publication"*/).ToList(); _magazines = _magazineRepository.Get(includeProperties: "Publication").ToList(); _publishingHouses = _publishingHouseRepository.Get().ToList(); _publications = _publicationRepository.Get().ToList(); }