public ActionResult Create(int id, TransferRequest transferRequest) { var rp = Repository.OfType<RegistrationParticipation>().GetNullableById(id); if (rp == null) { Message = "Registration participation could not be loaded, please try again."; return RedirectToAction("Index", "Admin"); } transferRequest.User = Repository.OfType<vUser>().Queryable.FirstOrDefault(a => a.LoginId == User.Identity.Name); transferRequest.RegistrationParticipation = rp; ModelState.Clear(); transferRequest.TransferValidationMessagesTo(ModelState); if (ModelState.IsValid) { Message = "Transfer request created."; Repository.OfType<TransferRequest>().EnsurePersistent(transferRequest); return RedirectToAction("StudentDetails", "Admin", new {id = rp.Registration.Student.Id}); } var viewModel = TransferRequestViewModel.Create(Repository, rp, User.Identity.Name); return View(viewModel); }