コード例 #1
0
        public static void Insert(ProductComment comment)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                db.ProductComments.Add(comment);

                db.SaveChanges();
            }
        }
コード例 #2
0
        public static void Update(ProductComment comment)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                var orgComment = db.ProductComments.Where(item => item.ID == comment.ID).Single();

                orgComment.CommentStatus = comment.CommentStatus;
                orgComment.Subject       = comment.Subject;
                orgComment.Text          = comment.Text;

                db.SaveChanges();
            }
        }