public IActionResult GetById(int id)
        {
            var magazine    = _magazineService.GetById(id);
            var magazineDto = _mapper.Map <MagazineDto>(magazine);

            return(Ok(magazineDto));
        }
示例#2
0
        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);
        }
示例#3
0
        public async Task <IActionResult> GetById(int id)
        {
            GetByIdMagazineView getById = await _magazineService.GetById(id);

            return(Ok(getById));
        }