public static void Insert(ProductCommentRate productCommentRate) { using (var db = OnlineStoreDbContext.Entity) { db.ProductCommentRates.Add(productCommentRate); db.SaveChanges(); } }
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(); } }