Add new Model Unit and changed some Logik to some Properties
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
public class Category
|
public class Category
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string? Name { get; set; }
|
public string Name { get; set; }
|
||||||
public virtual ICollection<Recipe> Recipes { get; set; } = new List<Recipe>();
|
public virtual ICollection<Recipe> Recipes { get; set; } = new List<Recipe>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Francesco.Recipes.World.Models.BackendModels
|
|
||||||
{
|
|
||||||
public interface ITimeStampedEntity
|
|
||||||
{
|
|
||||||
DateTime CreatedAt { get; set; }
|
|
||||||
|
|
||||||
DateTime? ModifiedAt { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
namespace Francesco.Recipes.World.Models.BackendModels.Ingredient
|
namespace Francesco.Recipes.World.Models.BackendModels.Ingredient
|
||||||
{
|
{
|
||||||
|
using Francesco.Recipes.World.Models.BackendModels.Unit;
|
||||||
public class Ingredient
|
public class Ingredient
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string? Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string? Unit { get; set; }
|
public virtual Unit Unit { get; set; } = new();
|
||||||
|
public int Quantity { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
public class Instruction
|
public class Instruction
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string? StepDescription { get; set; }
|
public string Description { get; set; }
|
||||||
public string? StepNumber { get; set; }
|
public string Number { get; set; }
|
||||||
public virtual Recipe Recipe { get; set; } = new();
|
public virtual Recipe Recipe { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace Francesco.Recipes.World.Models.BackendModels.Rating
|
|
||||||
{
|
|
||||||
public class Rating
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,14 +6,13 @@
|
|||||||
public class Recipe
|
public class Recipe
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string? Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string? Difficulty { get; set; }
|
public string Difficulty { get; set; }
|
||||||
public int Servings { get; set; }
|
public int Servings { get; set; }
|
||||||
public TimeSpan PreparationTime { get; set; }
|
public TimeSpan PreparationTime { get; set; }
|
||||||
public TimeSpan CookingTime { get; set; }
|
public TimeSpan CookingTime { get; set; }
|
||||||
public virtual ICollection <RecipeIngredient> RecipeIngredients { get; set; } = new List<RecipeIngredient>();
|
public virtual ICollection <RecipeIngredient> RecipeIngredients { get; set; } = new List<RecipeIngredient>();
|
||||||
public virtual ICollection <Instruction> Instructions { get; set; } = new List<Instruction>();
|
public virtual ICollection <Instruction> Instructions { get; set; } = new List<Instruction>();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Francesco.Recipes.World.Models.BackendModels.Unit
|
||||||
|
{
|
||||||
|
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
|
||||||
|
|
||||||
|
public class Unit
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public virtual ICollection<Ingredient> Recipes { get; set; } = new List<Ingredient>();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user