Пример #1
0
 public async Task <IActionResult> Create()
 {
     return(View(new ArticleViewModel
     {
         Categories = categoriesRepository.FindAll().Select(c => new SelectListItem
         {
             Value = c.Id.ToString(),
             Text = c.Title
         }),
         Tags = tagsRepository.FindAll().Select(t => new SelectListItem
         {
             Value = t.Id.ToString(),
             Text = t.Title
         })
     }));
 }