From 83788b942de88e6b02fc038ffdf9971870abcc2c Mon Sep 17 00:00:00 2001 From: Maxime BATISTA Date: Wed, 26 Apr 2023 13:58:02 +0200 Subject: [PATCH] fix compilation errors --- Core/Account.cs | 33 --------------------------------- Core/Ingredient.cs | 26 -------------------------- Core/PreparationStep.cs | 24 ------------------------ Core/Quantity.cs | 12 ------------ Core/Recipe.cs | 36 ------------------------------------ Core/RecipeInformation.cs | 35 ----------------------------------- Core/User.cs | 23 ----------------------- Models/Account.cs | 15 +++++++++++++++ Models/Ingredient.cs | 18 ++++++++++++++++++ Models/PreparationStep.cs | 17 +++++++++++++++++ Models/Quantity.cs | 7 +++++++ Models/Recipe.cs | 26 ++++++++++++++++++++++++++ Models/RecipeInfo.cs | 20 ++++++++++++++++++++ Models/User.cs | 16 ++++++++++++++++ 14 files changed, 119 insertions(+), 189 deletions(-) delete mode 100644 Core/Account.cs delete mode 100644 Core/Ingredient.cs delete mode 100644 Core/PreparationStep.cs delete mode 100644 Core/Quantity.cs delete mode 100644 Core/Recipe.cs delete mode 100644 Core/RecipeInformation.cs delete mode 100644 Core/User.cs create mode 100644 Models/Account.cs create mode 100644 Models/Ingredient.cs create mode 100644 Models/PreparationStep.cs create mode 100644 Models/Quantity.cs create mode 100644 Models/Recipe.cs create mode 100644 Models/RecipeInfo.cs create mode 100644 Models/User.cs diff --git a/Core/Account.cs b/Core/Account.cs deleted file mode 100644 index 23990fe..0000000 --- a/Core/Account.cs +++ /dev/null @@ -1,33 +0,0 @@ -using ShoopNCook.Pages; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - internal class Account - { - private readonly User user; - private readonly string email; - - private List favoriteRecipes; - - public Account(User user, string email) - { - this.user = user; - this.email = email; - } - - public User User { get => user; } - public string Email { get => email; } - - public List Favorites { get => favoriteRecipes; } - - public void AddFavoriteRecipe(RecipeInformation recipe) - { - favoriteRecipes.Add(recipe); - } - } -} diff --git a/Core/Ingredient.cs b/Core/Ingredient.cs deleted file mode 100644 index 72509cc..0000000 --- a/Core/Ingredient.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - internal class Ingredient - { - - private readonly string name; - private readonly float amount; - private readonly Quantity quantity; - - public Ingredient(string name, float amount, Quantity quantity) { - this.name = name; - this.amount = amount; - this.quantity = quantity; - } - - public string Name { get => name; } - public float Amount { get => amount; } - public Quantity Quantity { get => quantity;} - } -} diff --git a/Core/PreparationStep.cs b/Core/PreparationStep.cs deleted file mode 100644 index edc038a..0000000 --- a/Core/PreparationStep.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - - internal class PreparationStep - { - private string name; - private string description; - - public PreparationStep(string name, string description) - { - this.name = name; - this.description = description; - } - - public string Name { get => name; } - public string Description { get => description; } - } -} diff --git a/Core/Quantity.cs b/Core/Quantity.cs deleted file mode 100644 index 2b5861b..0000000 --- a/Core/Quantity.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - internal class Quantity - { - } -} diff --git a/Core/Recipe.cs b/Core/Recipe.cs deleted file mode 100644 index 478de13..0000000 --- a/Core/Recipe.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - internal class Recipe - { - - private readonly RecipeInformation info; - private readonly User owner; - - private readonly List ingredients; - private readonly List steps; - - public Recipe( - RecipeInformation info, - User owner, - List ingredients, - List steps) - { - this.info = info; - this.owner = owner; - this.ingredients = ingredients; - this.steps = steps; - } - - public RecipeInformation Info { get => info; } - public User Owner { get => owner; } - - public List Ingredients { get => ingredients; } - public List Steps { get => steps; } - } -} diff --git a/Core/RecipeInformation.cs b/Core/RecipeInformation.cs deleted file mode 100644 index d9673a6..0000000 --- a/Core/RecipeInformation.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - internal class RecipeInformation - { - private string name; - private string description; - private Uri image; - private float averageNote; - private int cookTimeMinutes; - private int caloriesPerGuest; - - public RecipeInformation(string name, string description, Uri image, float averageNote, int cookTimeMinutes, int caloriesPerGuest) - { - this.name = name; - this.description = description; - this.image = image; - this.averageNote = averageNote; - this.cookTimeMinutes = cookTimeMinutes; - this.caloriesPerGuest = caloriesPerGuest; - } - - public string Name { get => name; } - public string Description { get => description; } - public Uri Image { get => image; } - public float AverageNote { get => averageNote; } - public int CookTimeMinutes { get => cookTimeMinutes; } - public int CaloriesPerGuest { get => caloriesPerGuest; } - } -} diff --git a/Core/User.cs b/Core/User.cs deleted file mode 100644 index 9698860..0000000 --- a/Core/User.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ShoopNCook.Core -{ - internal class User - { - private string name; - private Uri profilePicture; - - public User(Uri profilePicture, string name) - { - this.profilePicture = profilePicture; - this.name = name; - } - - public Uri ProfilePicture { get; } - public string Name { get; } - } -} diff --git a/Models/Account.cs b/Models/Account.cs new file mode 100644 index 0000000..ff30e30 --- /dev/null +++ b/Models/Account.cs @@ -0,0 +1,15 @@ +namespace ShoopNCook.Models +{ + internal class Account + { + + public Account(User usr, string mail) + { + User = usr; + Email = mail; + } + + public User User { get; init; } + public string Email { get; init; } + } +} diff --git a/Models/Ingredient.cs b/Models/Ingredient.cs new file mode 100644 index 0000000..6778eac --- /dev/null +++ b/Models/Ingredient.cs @@ -0,0 +1,18 @@ + +namespace ShoopNCook.Models +{ + internal class Ingredient + { + + + public Ingredient(string name, float amount, Quantity quantity) { + Name = name; + Amount = amount; + Quantity = quantity; + } + + public string Name { get; init; } + public float Amount { get; init; } + public Quantity Quantity { get; init; } + } +} diff --git a/Models/PreparationStep.cs b/Models/PreparationStep.cs new file mode 100644 index 0000000..e9427f3 --- /dev/null +++ b/Models/PreparationStep.cs @@ -0,0 +1,17 @@ + +namespace ShoopNCook.Models +{ + + internal class PreparationStep + { + + public PreparationStep(string name, string description) + { + this.Name = name; + this.Description = description; + } + + public string Name { get; init; } + public string Description { get; init; } + } +} diff --git a/Models/Quantity.cs b/Models/Quantity.cs new file mode 100644 index 0000000..b788f56 --- /dev/null +++ b/Models/Quantity.cs @@ -0,0 +1,7 @@ + +namespace ShoopNCook.Models +{ + internal class Quantity + { + } +} diff --git a/Models/Recipe.cs b/Models/Recipe.cs new file mode 100644 index 0000000..dde2b65 --- /dev/null +++ b/Models/Recipe.cs @@ -0,0 +1,26 @@ + +namespace ShoopNCook.Models +{ + internal class Recipe + { + + public RecipeInfo Info { get; init; } + + public User Owner { get; init; } + + public List Ingredients { get; init; } + public List Steps { get; init; } + + public Recipe( + RecipeInfo info, + User owner, + List ingredients, + List steps) + { + Info = info; + Owner = owner; + Ingredients = ingredients; + Steps = steps; + } + } +} \ No newline at end of file diff --git a/Models/RecipeInfo.cs b/Models/RecipeInfo.cs new file mode 100644 index 0000000..1cdfe18 --- /dev/null +++ b/Models/RecipeInfo.cs @@ -0,0 +1,20 @@ + +namespace ShoopNCook.Models +{ + + internal class RecipeInfo + { + public string Name { get; init; } + public string Description { get; init; } + public Uri Image { get; init; } + public float AverageNote { get; init; } + + public RecipeInfo(string name, string description, Uri image, float averageNote) + { + Name = name; + Description = description; + Image = image; + AverageNote = averageNote; + } + } +} diff --git a/Models/User.cs b/Models/User.cs new file mode 100644 index 0000000..918032f --- /dev/null +++ b/Models/User.cs @@ -0,0 +1,16 @@ + +namespace ShoopNCook.Models +{ + internal class User + { + + public User(Uri profilePicture, string name) + { + ProfilePicture = profilePicture; + Name = name; + } + + public Uri ProfilePicture { get; init; } + public string Name { get; init; } + } +}