public async Task <IActionResult> OnGetAsync(Guid id) { if (id == null) { return(NotFound()); } //Techs = await _context.Techs.SingleOrDefaultAsync(m => m.Pk == id); Techs = await _context.Techs .Where(x => x.TenantID == _options.Value.Debug.TenantID) .Where(x => x.ID == id) .FirstOrDefaultAsync(); if (Techs == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid id) { if (id == null) { return(NotFound()); } //Techs = await _context.Techs.FindAsync(id); Techs = await _context.Techs .Where(x => x.TenantID == _options.Value.Debug.TenantID) .Where(x => x.ID == id) .FirstOrDefaultAsync(); if (Techs != null) { _context.Techs.Remove(Techs); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }