Пример #1
0
        /// <summary>
        /// 新增文章
        /// </summary>
        /// <param name="category_id"></param>
        /// <param name="name"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public async Task <dynamic> CreateArticle(ArticleViewModel_para para)
        {
            #region 驗證
            var check = await ArticleVerify(para);

            if (check != "success")
            {
                return(check);
            }
            #endregion
            var NewArticle = new TArticleModel()
            {
                f_article_id   = Guid.NewGuid(),
                f_category_id  = new Guid(para.category_id),
                f_article_name = para.article_name,
                f_content      = para.article_content
            };
            await _articleRepo.CreateArticle(NewArticle);

            return("success");
        }