public ActionResult New(GuestsNew form)
        {
            var guest = new Guest();

            SyncRoles(form.Roles, guest.Role);
            guest.Name = form.Name;
            guest.PasswordHash = form.Password;
            guest.Email = form.Email;
            Database.Session.Save(guest);
            Database.Session.Flush(); // I needed to add flush for the pivot table to update. Not sure why. but now it works.

            return RedirectToAction("index");
        }
 partial void UpdateGuest(Guest instance);
 partial void DeleteGuest(Guest instance);
 partial void InsertGuest(Guest instance);