Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerable<VMFoodFoodMeal> _fmt = (from e in db.FoodProgramMealFood
- join j in db.Foods on e.FoodId equals j.Id
- select new
- {
- Id = e.Id,
- Name = j.Name,
- });
- public void Linq103()
- {
- string[] categories = new string[]{
- "Beverages",
- "Condiments",
- "Vegetables",
- "Dairy Products",
- "Seafood" };
- List<Product> products = GetProductList();
- var q =
- from c in categories
- join p in products on c equals p.Category into ps
- select new { Category = c, Products = ps };
- foreach (var v in q)
- {
- Console.WriteLine(v.Category + ":");
- foreach (var p in v.Products)
- {
- Console.WriteLine(" " + p.ProductName);
- }
- }
- }
- IEnumerable<VMFoodFoodMeal> _fmt = (from e in db.FoodProgramMealFood
- join j in db.Foods on e.FoodId equals j.Id
- select new VMFoodFoodMeal()
- {
- Id = e.Id,
- Name = j.Name,
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement