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