示例#1
0
        public async Task <IActionResult> GetArticle(int id)
        {
            var article = await _articlesRepo.GetArticle(id);

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

            return(Ok(article));
        }
        public IActionResult CreateOrEditArticle(int?id)
        {
            Article article = _articlesRepository.GetArticle(id);

            if (article == null)
            {
                article = new Article();
            }

            ViewBag.Authors         = _selectListRepository.GetSelectListAuthors();
            ViewBag.ScienceJournals = _selectListRepository.GetSelectListScienceJournals(article.ScienceJournalId);
            ViewBag.Years           = _selectListRepository.GetSelectListYears(article.YearId);
            ViewBag.NirSpecials     = _selectListRepository.GetSelectListNirSpecials();
            ViewBag.NirTemas        = _selectListRepository.GetSelectListNirTemas();

            return(View(article));
        }
        public async Task <ActionResult <Article> > GetArticleById(int id)
        {
            var article = await _articlesRepository.GetArticle(id);

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

            return(Ok(article));
        }
示例#4
0
 public byte[] GetImage(int articleId)
 {
     return(_data.GetArticle(articleId));
 }