예제 #1
0
        public void Update(d.Review newReview)
        {
            var entity = _context.Reviews.Find(newReview.ReviewId);

            entity.DoctorId = newReview.DoctorId;
            entity.UserId   = newReview.UserId;
            entity.Rating   = newReview.Rating;
            entity.Review1  = newReview.Content;
            _context.Reviews.Update(entity);
            _context.SaveChanges();
        }
예제 #2
0
        public int Add(d.Review newReview)
        {
            var entity = new Review
            {
                DoctorId = newReview.DoctorId,
                UserId   = newReview.UserId,
                Rating   = newReview.Rating,
                Review1  = newReview.Content
            };

            _context.Reviews.Add(entity);
            _context.SaveChanges();
            return(entity.ReviewId);
        }