public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } PartnerCompany = await _context.PartnerCompanies .Include(p => p.Person).FirstOrDefaultAsync(m => m.Id == id); if (PartnerCompany == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid?id) { if (id == null) { return(NotFound()); } PartnerCompany = await _context.PartnerCompanies.FindAsync(id); if (PartnerCompany != null) { PartnerCompany.IsDeleted = true; await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } PartnerCompany = await _context.PartnerCompanies .Include(p => p.Person).FirstOrDefaultAsync(m => m.Id == id); if (PartnerCompany == null) { return(NotFound()); } ViewData["PersonId"] = new SelectList(_context.People, "Id", "Id"); return(Page()); }