public IActionResult OnGet() { ViewData["AgentId"] = new SelectList(_context.Agent, "Id", "FullName"); ViewData["CityId"] = new SelectList(_context.City, "Id", "Name"); ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name"); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Agent = await _context.Agent .Include(a => a.SalesOffice).FirstOrDefaultAsync(m => m.Id == id); if (Agent == null) { return(NotFound()); } ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name"); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Dwelling = await _context.Dwelling .Include(d => d.Agent) .Include(d => d.City) .Include(d => d.SalesOffice).FirstOrDefaultAsync(m => m.Id == id); if (Dwelling == null) { return(NotFound()); } ViewData["AgentId"] = new SelectList(_context.Agent, "Id", "FullName"); ViewData["CityId"] = new SelectList(_context.City, "Id", "Name"); ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name"); return(Page()); }
public IActionResult OnGet() { ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name"); return(Page()); }