public async Task <IActionResult> DeleteConfirmed(string id) { var user = await _applicationUserService.GetUserById(id); if (user == null) { return(NotFound()); } try { await _applicationUserService.DeleteAndSave(id); return(Json(new { html = Helper.RenderRazorViewToString(this, "Index", _applicationUserService.GetAllUsers()) })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }