From b2ba51d2970dacaadebfaf5cb0810e390b3b3825 Mon Sep 17 00:00:00 2001 From: Francesco D'Amico Date: Sun, 30 Mar 2025 15:56:01 +0200 Subject: [PATCH] update model --- .../Models/BackendModels/Ingredient/Ingredient.cs | 2 +- .../IngredientsShoppingList.cs | 14 -------------- .../Models/BackendModels/Recipe/Recipe.cs | 3 +++ .../RecipeIngredientShoppingList.cs | 14 ++++++++++++++ .../BackendModels/Shoppinglist/ShoppingList.cs | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 Francesco.Recipes.World/Models/BackendModels/IngredientShoppingList/IngredientsShoppingList.cs create mode 100644 Francesco.Recipes.World/Models/BackendModels/RecipeIngredientShoppingList/RecipeIngredientShoppingList.cs diff --git a/Francesco.Recipes.World/Models/BackendModels/Ingredient/Ingredient.cs b/Francesco.Recipes.World/Models/BackendModels/Ingredient/Ingredient.cs index c4c43c3..ccc9ba1 100644 --- a/Francesco.Recipes.World/Models/BackendModels/Ingredient/Ingredient.cs +++ b/Francesco.Recipes.World/Models/BackendModels/Ingredient/Ingredient.cs @@ -11,6 +11,6 @@ public virtual ICollection RecipeIngredients { get; set; } = new List(); - public virtual ICollection IngredientShoppingLists { get; set; } = new List(); + public virtual ICollection IngredientShoppingLists { get; set; } = new List(); } } diff --git a/Francesco.Recipes.World/Models/BackendModels/IngredientShoppingList/IngredientsShoppingList.cs b/Francesco.Recipes.World/Models/BackendModels/IngredientShoppingList/IngredientsShoppingList.cs deleted file mode 100644 index 78f92d7..0000000 --- a/Francesco.Recipes.World/Models/BackendModels/IngredientShoppingList/IngredientsShoppingList.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Francesco.Recipes.World.Models.BackendModels.IngredientShoppingList -{ - using Francesco.Recipes.World.Models.BackendModels.Ingredient; - using Francesco.Recipes.World.Models.BackendModels.Shoppinglist; - - public class IngredientsShoppingList - { - public Guid Id { get; set; } - - public ShoppingList Shoppinglist { get; set; } = new (); - - public Ingredient Ingredient { get; set; } = new (); - } -} diff --git a/Francesco.Recipes.World/Models/BackendModels/Recipe/Recipe.cs b/Francesco.Recipes.World/Models/BackendModels/Recipe/Recipe.cs index da673d7..977b9ad 100644 --- a/Francesco.Recipes.World/Models/BackendModels/Recipe/Recipe.cs +++ b/Francesco.Recipes.World/Models/BackendModels/Recipe/Recipe.cs @@ -1,5 +1,6 @@ namespace Francesco.Recipes.World.Models.BackendModels.Recipe; +using Francesco.Recipes.World.Models.BackendModels.Category; using Francesco.Recipes.World.Models.BackendModels.Favorit; using Francesco.Recipes.World.Models.BackendModels.Instruction; using Francesco.Recipes.World.Models.BackendModels.MediaFile; @@ -34,4 +35,6 @@ public class Recipe : ITimeStampedEntity public virtual ICollection MediaFiles { get; set; } = new List(); public virtual Favorit Favorit { get; set; } = new (); + + public virtual Category Category { get; set; } = new (); } diff --git a/Francesco.Recipes.World/Models/BackendModels/RecipeIngredientShoppingList/RecipeIngredientShoppingList.cs b/Francesco.Recipes.World/Models/BackendModels/RecipeIngredientShoppingList/RecipeIngredientShoppingList.cs new file mode 100644 index 0000000..1878caf --- /dev/null +++ b/Francesco.Recipes.World/Models/BackendModels/RecipeIngredientShoppingList/RecipeIngredientShoppingList.cs @@ -0,0 +1,14 @@ +namespace Francesco.Recipes.World.Models.BackendModels.IngredientShoppingList +{ + using Francesco.Recipes.World.Models.BackendModels.RecipeIngredient; + using Francesco.Recipes.World.Models.BackendModels.Shoppinglist; + + public class RecipeIngredientShoppingList + { + public Guid Id { get; set; } + + public virtual ShoppingList ShoppingList { get; set; } = new (); + + public virtual RecipeIngredient RecipeIngredient { get; set; } = new (); + } +} diff --git a/Francesco.Recipes.World/Models/BackendModels/Shoppinglist/ShoppingList.cs b/Francesco.Recipes.World/Models/BackendModels/Shoppinglist/ShoppingList.cs index 71fc7e7..c8fd12f 100644 --- a/Francesco.Recipes.World/Models/BackendModels/Shoppinglist/ShoppingList.cs +++ b/Francesco.Recipes.World/Models/BackendModels/Shoppinglist/ShoppingList.cs @@ -10,6 +10,6 @@ public DateTime? ModifiedAt { get; set; } - public virtual ICollection IngredientsShoppingLists { get; set; } = new List(); + public virtual ICollection RecipeIngredientShoppingLists { get; set; } = new List(); } }