コード例 #1
0
ファイル: Create.cs プロジェクト: Seamus-Ohhhh/SapremaPhoenix
        public bool CreateMeditationReview(SapReviewMeditation meditationReview)
        {
            using (var dbConn = new SapremaFinalContext())
            {
                meditationReview.ReviewMeditationId = Guid.NewGuid();
                dbConn.SapReviewMeditation.Add(meditationReview);
                dbConn.SaveChanges();

                return(true);
            }
        }
コード例 #2
0
 //Add meditation review to db
 public bool CreateMeditationReview(string userId, Guid meditationId, decimal reviewStars, string reviewComment)
 {
     using (var dbConn = new SapremaFinalContext())
     {
         SapReviewMeditation sapReviewMeditation = new SapReviewMeditation()
         {
             UserId        = userId,
             MeditationId  = meditationId,
             ReviewStars   = reviewStars,
             ReviewComment = reviewComment,
             //ReviewmeditationKey = Guid.NewGuid()
         };
         dbConn.SapReviewMeditation.Add(sapReviewMeditation);
         dbConn.SaveChanges();
     };
     return(true);
 }