Fixed errors SA1516

This commit is contained in:
Francesco D'Amico
2025-03-24 09:27:13 +01:00
parent 02533e9bfb
commit 41f41ce3fb
14 changed files with 83 additions and 11 deletions
@@ -1,10 +1,13 @@
namespace Francesco.Recipes.World.Models.BackendModels.Category
{
using Francesco.Recipes.World.Models.BackendModels.Recipe;
public class Category
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public virtual ICollection<Recipe> Recipes { get; set; } = new List<Recipe>();
}
}
@@ -5,7 +5,9 @@
public class Favorit
{
public Guid Id { get; set; }
public DateTime CreatedAt { get; set; }
public virtual ICollection<Recipe> Recipe { get; set; } = new List<Recipe>();
}
}
@@ -6,8 +6,11 @@
public class Ingredient
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public virtual ICollection<RecipeIngredient> RecipeIngredients { get; set; } = new List<RecipeIngredient>();
public virtual ICollection<IngredientsShoppingList> IngredientShoppingLists { get; set; } = new List<IngredientsShoppingList>();
}
}
@@ -6,7 +6,9 @@
public class IngredientsShoppingList
{
public Guid Id { get; set; }
public ShoppingList Shoppinglist { get; set; } = new ();
public Ingredient Ingredient { get; set; } = new ();
}
}
@@ -2,12 +2,17 @@
{
using Francesco.Recipes.World.Models.BackendModels.MediaFile;
using Francesco.Recipes.World.Models.BackendModels.Recipe;
public class Instruction
{
public Guid Id { get; set; }
public string Description { get; set; } = string.Empty;
public int Number { get; set; }
public virtual Recipe Recipe { get; set; } = new ();
public virtual ICollection<MediaFile> MediaFiles { get; set; } = new List<MediaFile>();
}
}
@@ -2,6 +2,7 @@
{
using Francesco.Recipes.World.Models.BackendModels.Instruction;
using Francesco.Recipes.World.Models.BackendModels.Recipe;
public class MediaFile
{
public Guid Id { get; set; } = Guid.NewGuid();
@@ -11,7 +12,9 @@
public string? MimeType { get; set; }
public byte[]? Data { get; set; }
public virtual Recipe? Recipe { get; set; } = new ();
public virtual Instruction Instruction { get; set; } = new ();
}
}
@@ -3,9 +3,13 @@
public enum Difficulty
{
VeryEasy = 1,
Easy = 2,
Medium = 3,
Hard = 4,
Expert = 5,
}
}
@@ -8,17 +8,30 @@ using Francesco.Recipes.World.Models.BackendModels.RecipeIngredient;
public class Recipe : ITimeStampedEntity
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public Difficulty Difficulty { get; set; }
public int Servings { get; set; }
public TimeSpan PreparationTime { get; set; }
public TimeSpan CookingTime { get; set; }
public bool IsFavorite { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public virtual ICollection<RecipeIngredient> RecipeIngredients { get; set; } = new List<RecipeIngredient>();
public virtual ICollection<Instruction> Instructions { get; set; } = new List<Instruction>();
public virtual ICollection<MediaFile> MediaFiles { get; set; } = new List<MediaFile>();
public virtual Favorit Favorit { get; set; } = new ();
}
@@ -3,12 +3,17 @@
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
using Francesco.Recipes.World.Models.BackendModels.Recipe;
using Francesco.Recipes.World.Models.BackendModels.Unit;
public class RecipeIngredient
{
public Guid Id { get; set; }
public virtual Recipe Recipe { get; set; } = new ();
public virtual Ingredient Ingredient { get; set; } = new ();
public virtual Unit Unit { get; set; } = new ();
public int Quantity { get; set; }
}
}
@@ -5,8 +5,11 @@
public class ShoppingList : ITimeStampedEntity
{
public Guid Id { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public virtual ICollection<IngredientsShoppingList> IngredientsShoppingLists { get; set; } = new List<IngredientsShoppingList>();
}
}
@@ -1,11 +1,15 @@
namespace Francesco.Recipes.World.Models.BackendModels.Unit;
namespace Francesco.Recipes.World.Models.BackendModels.Unit
{
using Francesco.Recipes.World.Models.BackendModels.RecipeIngredient;
public class Unit
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Symbol { get; set; } = string.Empty;
public virtual ICollection<RecipeIngredient> RecipeIngredient { get; set; } = new List<RecipeIngredient>();
}
}