Example #1
0
 public IActionResult OnGet()
 {
     ViewData["CompanyId"]  = new SelectList(_context.Set <Company>(), "CompanyId", "CompanyName");    //changing value in the key value pair to company name
     ViewData["IndustryId"] = new SelectList(_context.Set <Industry>(), "IndustryId", "IndustryName"); //changing value in the key value pair to industry name
     ViewData["JobTitleId"] = new SelectList(_context.Set <JobTitle>(), "JobTitleId", "JobTitleName"); //changing value in the key value pair to jobtitle name
     return(Page());
 }
Example #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Candidate = await _context.Candidate
                        .Include(c => c.Company)
                        .Include(c => c.Industry)
                        .Include(c => c.JobTitle).FirstOrDefaultAsync(m => m.CandidateId == id);

            if (Candidate == null)
            {
                return(NotFound());
            }
            ViewData["CompanyId"]  = new SelectList(_context.Set <Company>(), "CompanyId", "CompanyName");
            ViewData["IndustryId"] = new SelectList(_context.Set <Industry>(), "IndustryId", "IndustryName");
            ViewData["JobTitleId"] = new SelectList(_context.Set <JobTitle>(), "JobTitleId", "JobTitleName");
            return(Page());
        }