private void RefreshAssessments(string searchText) { if (!string.IsNullOrEmpty(searchText)) { ClientAssessments = Assessments.Where(u => u.Name.Contains(searchText, StringComparison.OrdinalIgnoreCase)).ToList(); StateHasChanged(); } else { ClientAssessments = Assessments.ToList(); StateHasChanged(); } }
private async Task DeleteItem(bool shouldDelete) { if (shouldDelete) { await _assessmentService.DeleteAssesment(DeleteAssessmentId); Assessments = Assessments.Where(u => u.Id != DeleteAssessmentId).ToList(); RefreshAssessments(SearchText); DeleteAssessmentId = string.Empty; toastService.ShowSuccess("Assessment deleted successfully"); } }