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); } }
public async Task <Users> AddAsync(Users user) { return(await _project3DB.AddAsync(user)); }
public Task <Contents> AddAsync(Contents _contents) { _contents = XssFilter(_contents); return(_project3DB.AddAsync(_contents)); }
public async Task <Files> AddAsync(Files file) { return(await _project3DB.AddAsync(file)); }
public async Task <Metas> AddAsync(Metas meta) { return(await _project3DB.AddAsync(meta)); }