public async Task <IActionResult> Create([Bind("Id,Name,ContactNumber")] Candidate candidate) { if (ModelState.IsValid) { _context.Add(candidate); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(candidate)); }
public async Task <IActionResult> Create([Bind("Id,Name,ContactNumber,WebSite")] Employer employer) { if (ModelState.IsValid) { _context.Add(employer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employer)); }
public async Task <IActionResult> Create([Bind("Id,Title,Description,EmployerId,SalaryInformation,JobType")] Advertisement advertisement) { if (ModelState.IsValid) { _context.Add(advertisement); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployerId"] = new SelectList(_context.Set <Employer>(), "Id", "Id", advertisement.EmployerId); return(View(advertisement)); }
public async Task <IActionResult> Create([Bind("Id,AdvertisementId,CandidateId")] Application application) { if (ModelState.IsValid) { _context.Add(application); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AdvertisementId"] = new SelectList(_context.Advertisement, "Id", "Id", application.AdvertisementId); ViewData["CandidateId"] = new SelectList(_context.Set <Candidate>(), "Id", "Id", application.CandidateId); return(View(application)); }