public async Task <IActionResult> OnPostAsync(string submit) { try { if (string.Compare(submit, "delete", true) == 0) { await _adminServices.DeleteApiResourceByIdAsync(TenantId, Input.Id); } } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(Page()); } return(RedirectToPage("../Index")); }