I have two tables : Category and ProductFilter.Category table is hierarchy and I have depth in each row like it start at 1.Categories in level two have List<ProductFilter>.user clicked on category and I want to get ProductFilter to do this I have two code . which one is better :1.var category = _categories.Where(row => row.Code == categoryCode).FirstOrDefault();var attributesModel =new  List<Entities.ProductFilter>();if (category.Depth == 2)    attributesModel = category.ProductFilters.ToList();else if (category.Depth == 3)    attributesModel = category.Parent.ProductFilters.ToList();else if (category.Depth == 4)    attributesModel = category.Parent.Parent.ProductFilters.ToList();2.var attributesModel =     await _productFilters        .Where(row => row.Categories.Any(c =>             c.Code == categoryCode ||             c.Categories.Any(item => item.Code==categoryCode)))        .ToListAsync();
get ProductFilters in hierarchy table
c#;comparative review;linq;entity framework