public async Task <IActionResult> Edit(int id, [Bind("Id,Name,ContactNumber")] Candidate candidate)
        {
            if (id != candidate.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(candidate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CandidateExists(candidate.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,ContactNumber,WebSite")] Employer employer)
        {
            if (id != employer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployerExists(employer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employer));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Description,EmployerId,SalaryInformation,JobType")] Advertisement advertisement)
        {
            if (id != advertisement.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(advertisement);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdvertisementExists(advertisement.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployerId"] = new SelectList(_context.Set <Employer>(), "Id", "Id", advertisement.EmployerId);
            return(View(advertisement));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,AdvertisementId,CandidateId")] Application application)
        {
            if (id != application.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(application);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ApplicationExists(application.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }