public ActionResult Create()
 {
     ContactFolderOwner contactfolderowner = new ContactFolderOwner();
     ViewBag.PossibleContactFolders = contactfolderRepository.All;
     ViewBag.PossibleShareWithUsers = userRepository.All;
     return View(contactfolderowner);
 }
 public ActionResult Create(ContactFolderOwner contactfolderowner)
 {
     if (ModelState.IsValid) {
         contactfolderownerRepository.InsertOrUpdate(contactfolderowner);
         contactfolderownerRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossibleContactFolders = contactfolderRepository.All;
         ViewBag.PossibleShareWithUsers = userRepository.All;
         return View(contactfolderowner);
     }
 }
 public ViewResult Search(ContactFolderOwner searchContactFolderOwner)
 {
     if(searchContactFolderOwner!=null)
     {
                     }
                 return View("Index",contactfolderownerRepository.AllIncluding(contactfolderowner => contactfolderowner.ContactFolder, contactfolderowner => contactfolderowner.ShareWithUser));
 }
 public void InsertOrUpdate(ContactFolderOwner contactfolderowner)
 {
     if (contactfolderowner.ContactFolderOwnerID == default(int)) {
         // New entity
         context.ContactFolderOwner.Add(contactfolderowner);
     } else {
         // Existing entity
         context.Entry(contactfolderowner).State = EntityState.Modified;
     }
 }