public async Task <IActionResult> Create([Bind("Id,CompanyName,DateCreated,Active")] Company company) { if (ModelState.IsValid) { _context.Add(company); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Create([Bind("Id,Auth0,Firstname,Surname,Created,Accepted,VideoURL")] Candidate candidate) { if (ModelState.IsValid) { candidate.Id = Guid.NewGuid(); candidate.Auth0 = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier)?.Value; _context.Add(candidate); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Thanks))); } return(View(candidate)); }