Exemple #1
0
        public async Task <IActionResult> Edit(int id)
        {
            var news = await _newsRepository.GetNewsByIdAsync(id);

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

            ViewBag.GroupId = new SelectList(await _newsGroupRepository.GetAllNewsGroupsAsync(), "Id", "GroupTitle", news.NewsGroupId);

            return(View(news));
        }
        public async Task <IActionResult> NewsGroupList()
        {
            var newsGroups = await _newsGroupRepository.GetAllNewsGroupsAsync();

            return(View(newsGroups));
        }