public async Task <IActionResult> Edit(Guid id, [Bind("Id,RegistrationFormId,ApplicationUserId,CreationDate")] UserExpressInterest userExpressInterest) { if (id != userExpressInterest.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userExpressInterest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExpressInterestExists(userExpressInterest.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", userExpressInterest.ApplicationUserId); ViewData["RegistrationFormId"] = new SelectList(_context.RegistrationForms, "Id", "Id", userExpressInterest.RegistrationFormId); return(View(userExpressInterest)); }
public async Task <IActionResult> Create([Bind("Id,RegistrationFormId,ApplicationUserId,CreationDate")] UserExpressInterest userExpressInterest) { if (ModelState.IsValid) { userExpressInterest.Id = Guid.NewGuid(); _context.Add(userExpressInterest); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", userExpressInterest.ApplicationUserId); ViewData["RegistrationFormId"] = new SelectList(_context.RegistrationForms, "Id", "Id", userExpressInterest.RegistrationFormId); return(View(userExpressInterest)); }