From a3989b1a119d753488fba724aab09e4e27a6e8ea Mon Sep 17 00:00:00 2001 From: Roxane ROSSETTO Date: Thu, 25 May 2023 14:22:38 +0200 Subject: [PATCH] Modification of Recipe's constructor. Add recipe's picture. Changement of bindings in MyProfil, App and Home --- MCTG/Model/Recipes/Recipe.cs | 66 ++++++++++-------------------------- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/MCTG/Model/Recipes/Recipe.cs b/MCTG/Model/Recipes/Recipe.cs index aabc1c4..00668f8 100644 --- a/MCTG/Model/Recipes/Recipe.cs +++ b/MCTG/Model/Recipes/Recipe.cs @@ -120,45 +120,14 @@ namespace Model /// /// /// - /// The title of the recipe. - /// The steps of the preparation of the meal. - public Recipe(string title, params PreparationStep[] preparationSteps) - : this(title, null, null,null, new List(), new List(), preparationSteps) - { - } - - /// - /// - /// - - /// The title of the recipe. - /// The id of the recipe. If not given, get a new id. - /// Image that reppresent the recipe. - /// The steps of the preparation of the meal. - public Recipe(string title, int? id, string picture, params PreparationStep[] preparationSteps) - : this(title, id, null, picture, new List(), new List(), preparationSteps) - { - } - /// The title of the recipe. /// The id of the recipe. If not given, get a new id. + /// Mail of the user that create the recipe /// The steps of the preparation of the meal. - public Recipe(string title, int? id, params PreparationStep[] preparationSteps) - : this(title, id, null, null, new List(), new List(), preparationSteps) + public Recipe(string title, int? id, string? authorMail, params PreparationStep[] preparationSteps) + : this(title, id, authorMail, null, new List(), new List(), preparationSteps) { - } - /// - /// - /// - /// The title of the recipe. - /// The id of the recipe. If not given, get a new id. - /// Thr list of ingredients. - /// The steps of the preparation of the meal. - public Recipe(string title, int? id, List ingredients, - params PreparationStep[] preparationSteps) - : this(title, id, null, null, new List(), ingredients, preparationSteps) - { } /// @@ -167,26 +136,25 @@ namespace Model /// The title of the recipe. /// The id of the recipe. If not given, get a new id. /// Mail of the user that create the recipe - /// List of ingredients that compose the recipe. + /// Mail of the user that create the recipe /// List of ingredients that compose the recipe. /// The steps of the preparation of the meal. - public Recipe(string title, int? id, string? authorMail, List ingredients, params PreparationStep[] preparationSteps) - : this(title, id, authorMail, null, new List(), ingredients, preparationSteps) + public Recipe(string title, int? id, string? authorMail, string? picture, List ingredients, params PreparationStep[] preparationSteps) + : this(title, id, authorMail, picture, new List(), ingredients, preparationSteps) { } + ///// + ///// + ///// + ///// The title of the recipe. + ///// The id of the recipe. If not given, get a new id. + ///// Image that reppresent the recipe. + ///// The steps of the preparation of the meal. + //public Recipe(string title, int? id, string picture, params PreparationStep[] preparationSteps) + // : this(title, id, null, picture, new List(), new List(), preparationSteps) + //{ + //} - /// - /// - /// - /// The title of the recipe. - /// The id of the recipe. If not given, get a new id. - /// Mail of the user that create the recipe - /// The steps of the preparation of the meal. - public Recipe(string title, int? id, string? authorMail, params PreparationStep[] preparationSteps) - : this(title, id, authorMail, null, new List(), new List(), preparationSteps) - { - - } #endregion #region Methods