Exemple #1
0
        public OperationResult AddSectionConfig(SectionConfigDto dto)
        {
            var article = ArticleConfig.FindById(dto.ArticleId);

            if (article != null)
            {
                var section = Mapper.Map <SectionConfigDto, SectionConfig>(dto);
                section.ArticleId = article.Id;
                SectionConfig.Insert(section);
                return(UnitOfWork.Commit() > 0
                    ? new OperationResult(StatusCode.Okey)
                    : new OperationResult(StatusCode.Failed));
            }
            return(new OperationResult(StatusCode.NotFound, "失败了耶~刷新一下页面看看,会有惊喜哦"));
        }
        public void TestGetById()
        {
            var article = ArticleConfig.FindById(1);

            Assert.IsNotNull(article);
        }