public void Save() { renoRatorDBEntities db = new renoRatorDBEntities(); db.AddToReviews(this); foreach(double[] r in this.ratings) { ReviewRating rating = new ReviewRating(); rating.reviewID = this.reviewID; rating.ratingQuestionID = Convert.ToInt32(r[0]); rating.rating = r[1]; db.AddToReviewRatings(rating); } db.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the ReviewRatings EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToReviewRatings(ReviewRating reviewRating) { base.AddObject("ReviewRatings", reviewRating); }
/// <summary> /// Create a new ReviewRating object. /// </summary> /// <param name="reviewRatingID">Initial value of the reviewRatingID property.</param> /// <param name="reviewID">Initial value of the reviewID property.</param> /// <param name="ratingQuestionID">Initial value of the ratingQuestionID property.</param> /// <param name="rating">Initial value of the rating property.</param> public static ReviewRating CreateReviewRating(global::System.Int32 reviewRatingID, global::System.Int32 reviewID, global::System.Int32 ratingQuestionID, global::System.Double rating) { ReviewRating reviewRating = new ReviewRating(); reviewRating.reviewRatingID = reviewRatingID; reviewRating.reviewID = reviewID; reviewRating.ratingQuestionID = ratingQuestionID; reviewRating.rating = rating; return reviewRating; }