示例#1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CompanyEmployeeRegistration = await _context.CompanyEmployeeRegistration
                                          .Include(c => c.Company)
                                          .Include(c => c.Employee).FirstOrDefaultAsync(m => m.Id == id);

            if (CompanyEmployeeRegistration == null)
            {
                return(NotFound());
            }
            ViewData["CompanyId"]  = new SelectList(_context.Set <Company>(), "Id", "Name");
            ViewData["EmployeeId"] = new SelectList(_context.Set <Employee>(), "Id", "Name");
            return(Page());
        }
 public IActionResult OnGet()
 {
     ViewData["CompanyId"]  = new SelectList(_context.Set <Company>(), "Id", "Name");
     ViewData["EmployeeId"] = new SelectList(_context.Set <Employee>(), "Id", "Name");
     return(Page());
 }