using System.Collections.Generic;
public string Name { get; set; }
public string Name { get; set; }
public string Name { get; set; }
public User user { get; set; }
public Ingredient ing { get; set; }
public Recipe recipe { get; set; }
public Ingredient ing { get; set; }
public static void Main()
User shai = new User { Name = "Gidon" };
User ali = new User { Name = "ניסיתי ככה" };
Recipe pasta = new Recipe { Name = "pasta" };
Recipe pizza = new Recipe { Name = "pizza" };
Recipe burger = new Recipe { Name = "burger" };
Ingredient noodles = new Ingredient { Name = "noodles" };
Ingredient cheese = new Ingredient { Name = "cheese" };
Ingredient pepperoni = new Ingredient { Name = "cow #743875287" };
Ingredient buns = new Ingredient { Name = "buns" };
Ingredient sheep = new Ingredient { Name = "sheep" };
List<User_ing> user_ingredients = new List<User_ing> {
new User_ing { user = ali, ing = cheese },
new User_ing { user = ali, ing = pepperoni },
new User_ing { user = ali, ing = noodles },
new User_ing { user = ali, ing = sheep }
List<Recipe_ing> recipe_ingredients = new List<Recipe_ing> {
new Recipe_ing { recipe = pasta, ing = noodles },
new Recipe_ing { recipe = pizza, ing = cheese },
new Recipe_ing { recipe = pizza, ing = pepperoni },
new Recipe_ing { recipe = burger, ing = buns },
new Recipe_ing { recipe = burger, ing = sheep }
var query = recipe_ingredients.Join(
user_ingredients.Where(ing => ing.user == ali),
(recipe_ing, user_ing) => recipe_ing.recipe
Console.WriteLine("Ali's potential recipes:\n");
foreach (var obj in query)