Пример #1
0
        public async Task <IActionResult> Edit(int id)
        {
            var data = await _newsAppService.GetById(id);

            if (data == null)
            {
                return(NotFound());
            }

            return(View("FormNews", _mapper.Map <News, NewsViewModel>(data)));
        }
Пример #2
0
 public async Task <NewsViewModel> Get(string id)
 {
     return(await _newsAppService.GetById(id));
 }