Exemplo n.º 1
0
 public void AddIngredient(IngredientModel Ingredient, bool similar)
 {
     if (similar == false)
     {
         MyRecipe.Add(Ingredient);
     }
     else
     {
         SimilarRecipe.Add(Ingredient);
     }
 }
Exemplo n.º 2
0
 public void RemoveIngredient(IngredientModel Ingredient, bool similar)
 {
     if (similar == false)
     {
         MyRecipe.Remove(Ingredient);
     }
     else
     {
         SimilarRecipe.Remove(Ingredient);
     }
 }
Exemplo n.º 3
0
 // Constructor: pass in Ingredient and Score
 public RecommendationModel(IngredientModel Ingredient, double Score)
 {
     this.Ingredient = Ingredient;
     this.Score      = Score;
 }
Exemplo n.º 4
0
 // Constructor: pass in Ingredient
 public RecommendationModel(IngredientModel Ingredient)
 {
     this.Ingredient = Ingredient;
     Score           = 0.0;
 }
Exemplo n.º 5
0
 // Constructor
 public RecommendationModel()
 {
     Ingredient = new IngredientModel();
     Score      = 0.0;
 }
 // Remove Ingredient
 public void Remove(IngredientModel Ingredient)
 {
     Ingredients = Ingredients.Where(t => (t.Name != Ingredient.Name)).ToList();
 }
 // Add Ingredient
 public void Add(IngredientModel Ingredient)
 {
     Ingredients.Add(Ingredient);
 }