Exemplo n.º 1
0
        public static void Insert(ProductCommentRate productCommentRate)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                db.ProductCommentRates.Add(productCommentRate);

                db.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public static void Update(ProductCommentRate comment)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                var orgComment = db.ProductCommentRates.Where(item => item.ID == comment.ID).Single();

                orgComment.IsLike = comment.IsLike;

                db.SaveChanges();
            }
        }