public static async Task <List <Operation> > LinkCategories(this List <Operation> operations) { var categoriesAndSubCategories = await CategoriesDal.GetAllCategoriesAndSubCategoriesAsync(); operations.ForEach(op => op.GeneralCategory = categoriesAndSubCategories.FirstOrDefault(cat => cat.GlobalId == op.CategoryGlobalId)); return(operations); }
public async void Loaded() { _categoriesAndSubCategories = await CategoriesDal.GetAllCategoriesAndSubCategoriesAsync(); }