Пример #1
0
 public ActionResult Create([Bind(Include = "id,articleid,categoryid")] CreateArticleCategoriesDTO articleCategory)
 {
     if (ModelState.IsValid)
     {
         _articleCategoriesService.NewArticleCategories(articleCategory);
         return(RedirectToAction("Index"));
     }
     return(View(articleCategory));
 }
Пример #2
0
        public void NewArticleCategories(CreateArticleCategoriesDTO articleCategoryDTO)
        {
            ArticleCategory articleCategory = new ArticleCategory()
            {
                articleId  = articleCategoryDTO.articleId,
                categoryId = articleCategoryDTO.categoryId
            };

            _articleCategoryRepository.Insert(articleCategory);
        }