public void InsertOrUpdate(ReviewerGenre reviewergenre)
 {
     if (reviewergenre.ID == default(int)) {
         // New entity
         context.ReviewerGenres.Add(reviewergenre);
     } else {
         // Existing entity
         context.Entry(reviewergenre).State = EntityState.Modified;
     }
 }
 public ActionResult Create(ReviewerGenre reviewergenre)
 {
     if (ModelState.IsValid) {
         reviewergenreRepository.InsertOrUpdate(reviewergenre);
         reviewergenreRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossibleUsers = userRepository.All.Where(x => x.IsRoleReviewer == true);
         ViewBag.PossibleGenres = genreRepository.All;
         return View();
     }
 }