public IActionResult GetById(int id) { var magazine = _magazineService.GetById(id); var magazineDto = _mapper.Map <MagazineDto>(magazine); return(Ok(magazineDto)); }
private DetailsLeftColumnViewModel BindingDataForDetailsLeftColumnViewModel(int itemId) { var viewModel = new DetailsLeftColumnViewModel(); var item = _magazineService.GetById(itemId); if (item == null) { throw new NoNullAllowedException(string.Format("Item id={0}", itemId).ToNotNullErrorMessage()); } viewModel.CurrentItem = item; return(viewModel); }
public async Task <IActionResult> GetById(int id) { GetByIdMagazineView getById = await _magazineService.GetById(id); return(Ok(getById)); }