コード例 #1
0
        //Delete
        public void DeleteReviewerById(int id)
        {
            Reviewer reviewer = _db.Reviewers.Find(id);

            _db.Reviewers.Remove(reviewer);
            _db.SaveChanges();
        }
コード例 #2
0
        //Update
        public void UpdateReviewers(Reviewer reviewer2)
        {
            Reviewer reviewer1 = _db.Reviewers.Find(reviewer2.Id);

            reviewer1.Name    = reviewer2.Name;
            reviewer1.Comment = reviewer2.Comment;
            reviewer1.Rating  = reviewer2.Rating;
            _db.SaveChanges();
        }
コード例 #3
0
 //Create Reviewer
 public void CreateReviewer(Reviewer reviewer)
 {
     _db.Reviewers.Add(reviewer);
     _db.SaveChanges();
 }