예제 #1
0
        protected override async Task OnInitializedAsync()
        {
            ProjectViewModels = await ProjectDataService.GetProjectsAsync();


            //Not a fan of this nested logic
            //What I'm trying to do is collect every distinct category of a given type of CategoryTypeFilter
            foreach (ProjectViewModel projectVM in ProjectViewModels)
            {
                foreach (Category category in projectVM.Categories)
                {
                    if (!CategoryList.Contains <Category>(category) && category.Type == CategoryTypeFilter)
                    {
                        CategoryList.Add(category);
                    }
                }
            }
        }