コード例 #1
0
ファイル: RShuoshuocomment.cs プロジェクト: wjk-lovely/JiaoZi
        bool IShuoshuocomment.deletecomment(int commentid)
        {
            ShuoshuoComment shuoshuocomment = db.ShuoshuoComment.Where(b => b.ShuoshuoCommentID == commentid).FirstOrDefault();

            if (shuoshuocomment != null)
            {
                db.ShuoshuoComment.Remove(shuoshuocomment);
                db.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
ファイル: RShuoshuocomment.cs プロジェクト: wjk-lovely/JiaoZi
 void IShuoshuocomment.addshuocomment(ShuoshuoComment shuoshuocomment)
 {
     db.ShuoshuoComment.Add(shuoshuocomment);
     db.SaveChanges();
 }