|
|
@ -50,6 +50,7 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// The list of ingredients.
|
|
|
|
/// The list of ingredients.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[DataMember(Name = "ingredient")]
|
|
|
|
public List<Ingredient> Ingredients { get; set; }
|
|
|
|
public List<Ingredient> Ingredients { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -63,11 +64,11 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Construct a new recipe.
|
|
|
|
/// Construct a new recipe.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="title">The title of the recipe</param>
|
|
|
|
/// <param _name="title">The title of the recipe</param>
|
|
|
|
/// <param name="id">The id of the recipe. If not given, get a new id.</param>
|
|
|
|
/// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
|
|
|
/// <param name="reviews">Thr list of reviews.</param>
|
|
|
|
/// <param _name="reviews">Thr list of reviews.</param>
|
|
|
|
/// <param name="ingredients">Thr list of ingredients.</param>
|
|
|
|
/// <param _name="ingredients">Thr list of ingredients.</param>
|
|
|
|
/// <param name="preparationSteps">The steps of the preparation of the meal</param>
|
|
|
|
/// <param _name="preparationSteps">The steps of the preparation of the meal</param>
|
|
|
|
public Recipe(string title, int? id,
|
|
|
|
public Recipe(string title, int? id,
|
|
|
|
List<Review> reviews, List<Ingredient> ingredients,
|
|
|
|
List<Review> reviews, List<Ingredient> ingredients,
|
|
|
|
params PreparationStep[] preparationSteps)
|
|
|
|
params PreparationStep[] preparationSteps)
|
|
|
@ -90,7 +91,7 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="title">The title of the recipe.</param>
|
|
|
|
/// <param _name="title">The title of the recipe.</param>
|
|
|
|
public Recipe(string title)
|
|
|
|
public Recipe(string title)
|
|
|
|
: this(title, null, new List<Review>(), new List<Ingredient>())
|
|
|
|
: this(title, null, new List<Review>(), new List<Ingredient>())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -99,8 +100,8 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="title">The title of the recipe.</param>
|
|
|
|
/// <param _name="title">The title of the recipe.</param>
|
|
|
|
/// <param name="preparationSteps">The steps of the preparation of the meal.</param>
|
|
|
|
/// <param _name="preparationSteps">The steps of the preparation of the meal.</param>
|
|
|
|
public Recipe(string title, params PreparationStep[] preparationSteps)
|
|
|
|
public Recipe(string title, params PreparationStep[] preparationSteps)
|
|
|
|
: this(title, null, new List<Review>(), new List<Ingredient>(), preparationSteps)
|
|
|
|
: this(title, null, new List<Review>(), new List<Ingredient>(), preparationSteps)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -109,9 +110,9 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="title">The title of the recipe.</param>
|
|
|
|
/// <param _name="title">The title of the recipe.</param>
|
|
|
|
/// <param name="id">The id of the recipe. If not given, get a new id.</param>
|
|
|
|
/// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
|
|
|
/// <param name="preparationSteps">The steps of the preparation of the meal.</param>
|
|
|
|
/// <param _name="preparationSteps">The steps of the preparation of the meal.</param>
|
|
|
|
public Recipe(string title, int? id, params PreparationStep[] preparationSteps)
|
|
|
|
public Recipe(string title, int? id, params PreparationStep[] preparationSteps)
|
|
|
|
: this(title, id, new List<Review>(), new List<Ingredient>(), preparationSteps)
|
|
|
|
: this(title, id, new List<Review>(), new List<Ingredient>(), preparationSteps)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -120,10 +121,10 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// <inheritdoc cref="Recipe.Recipe(string, int?, List{Review}, PreparationStep[])"/>
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="title">The title of the recipe.</param>
|
|
|
|
/// <param _name="title">The title of the recipe.</param>
|
|
|
|
/// <param name="id">The id of the recipe. If not given, get a new id.</param>
|
|
|
|
/// <param _name="id">The id of the recipe. If not given, get a new id.</param>
|
|
|
|
/// <param name="ingredients">Thr list of ingredients.</param>
|
|
|
|
/// <param _name="ingredients">Thr list of ingredients.</param>
|
|
|
|
/// <param name="preparationSteps">The steps of the preparation of the meal.</param>
|
|
|
|
/// <param _name="preparationSteps">The steps of the preparation of the meal.</param>
|
|
|
|
public Recipe(string title, int? id, List<Ingredient> ingredients,
|
|
|
|
public Recipe(string title, int? id, List<Ingredient> ingredients,
|
|
|
|
params PreparationStep[] preparationSteps)
|
|
|
|
params PreparationStep[] preparationSteps)
|
|
|
|
: this(title, id, new List<Review>(), ingredients, preparationSteps)
|
|
|
|
: this(title, id, new List<Review>(), ingredients, preparationSteps)
|
|
|
@ -135,7 +136,7 @@ namespace Model
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Add a review for the recipe.
|
|
|
|
/// Add a review for the recipe.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="review">The new review to add.</param>
|
|
|
|
/// <param _name="review">The new review to add.</param>
|
|
|
|
public void AddReview(Review review)
|
|
|
|
public void AddReview(Review review)
|
|
|
|
=> Reviews.Add(review);
|
|
|
|
=> Reviews.Add(review);
|
|
|
|
|
|
|
|
|
|
|
@ -162,7 +163,7 @@ namespace Model
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
foreach (Ingredient ingredient in Ingredients)
|
|
|
|
foreach (Ingredient ingredient in Ingredients)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sb.Append("\t- " + ingredient + "\n");
|
|
|
|
sb.Append("\t- " + ingredient.ToString() + "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
return sb.ToString();
|
|
|
|