public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } OkrInnovationProperty = await _context.OkrInnovationProperties.FirstOrDefaultAsync(m => m.ID == id); if (OkrInnovationProperty == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } OkrInnovationProperty = await _context.OkrInnovationProperties.FindAsync(id); if (OkrInnovationProperty != null) { _context.OkrInnovationProperties.Remove(OkrInnovationProperty); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }