Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _products_lookup1 = _Products.ToLookup(o=> o.CategoryID);
- var _category_dict = _Categories.ToDictionary(c => c.CategoryID);
- var _products_lookup2 = _Products.ToLookup(a=> a.SupplierID);
- var _supplier_dict = Suppliers.ToDictionary(b=> b.SupplierID);
- foreach (var o in _Products) o.Category = _customers_dict[o.CustomerID];
- foreach (var c in _Categories) c.Products = _products_lookup1[c.CategoryID];
- foreach (var a in _Products) a.Supplier = _supplier_dict[a.SupplierID];
- foreach (var b in _Suppliers) b.Suppliers = _products_lookup2[b.SupplierID];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement