コード例 #1
0
        public async Task AddAsync(Comments comment)
        {
            var content = await _project3DB.Contents.Where(m => m.cid == comment.cid && m.status == 0).SingleOrDefaultAsync();

            if (content != null)
            {
                //评论html代码转义
                comment.content = System.Web.HttpUtility.HtmlEncode(comment.content);

                comment.nickname = System.Web.HttpUtility.HtmlEncode(comment.nickname);
                //添加评论
                await _project3DB.AddAsync(comment);

                //计数
                content.commentsnum++;
                await _project3DB.UpdateAsync(content);
            }
        }
コード例 #2
0
 public async Task <Users> AddAsync(Users user)
 {
     return(await _project3DB.AddAsync(user));
 }
コード例 #3
0
        public Task <Contents> AddAsync(Contents _contents)
        {
            _contents = XssFilter(_contents);

            return(_project3DB.AddAsync(_contents));
        }
コード例 #4
0
 public async Task <Files> AddAsync(Files file)
 {
     return(await _project3DB.AddAsync(file));
 }
コード例 #5
0
 public async Task <Metas> AddAsync(Metas meta)
 {
     return(await _project3DB.AddAsync(meta));
 }