Merge branch 'feature/Project_Config' into 'develop'
Add some configuration to Project See merge request francesco.damico/francescos.recipes.world!4
This commit is contained in:
+9
-1
@@ -126,7 +126,7 @@ dotnet_diagnostic.SA1601.severity = none
|
|||||||
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none
|
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none
|
||||||
|
|
||||||
# SA1516: Elements should be separated by blank line
|
# SA1516: Elements should be separated by blank line
|
||||||
dotnet_diagnostic.SA1516.severity = none
|
dotnet_diagnostic.SA1516.severity = error
|
||||||
|
|
||||||
# SA1649: File name should match first type name
|
# SA1649: File name should match first type name
|
||||||
dotnet_diagnostic.SA1649.severity = none
|
dotnet_diagnostic.SA1649.severity = none
|
||||||
@@ -142,3 +142,11 @@ dotnet_diagnostic.SA1309.severity = none
|
|||||||
|
|
||||||
# SA1309: Make sure class members are allowed to call without "this" prefix
|
# SA1309: Make sure class members are allowed to call without "this" prefix
|
||||||
dotnet_diagnostic.SA1101.severity = none
|
dotnet_diagnostic.SA1101.severity = none
|
||||||
|
# SA1118: parameter spans multiple lines
|
||||||
|
dotnet_diagnostic.SA1118.severity = none
|
||||||
|
# SA1011: closing square bracket spacing
|
||||||
|
dotnet_diagnostic.SA1011.severity = none
|
||||||
|
# SA1517: no blank lines at start of file
|
||||||
|
dotnet_diagnostic.SA1517.severity = none
|
||||||
|
# SA1200: using directive should appear within a namespace
|
||||||
|
dotnet_diagnostic.SA1200.severity = none
|
||||||
|
|||||||
+2
-2
@@ -396,5 +396,5 @@ FodyWeavers.xsd
|
|||||||
|
|
||||||
# JetBrains Rider
|
# JetBrains Rider
|
||||||
*.sln.iml
|
*.sln.iml
|
||||||
src/Recruitment.Tool.xml
|
src/Francesco.Recipes.World.xml
|
||||||
/Francesco.Recipes.World/Migrations/20250304095839_AddFewNewBackendModels.Designer.cs
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
namespace Francesco.Recipes.World.Data
|
namespace Francesco.Recipes.World.Data;
|
||||||
{
|
|
||||||
using Francesco.Recipes.World.Models.BackendModels;
|
using Francesco.Recipes.World.Models.BackendModels;
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Category;
|
using Francesco.Recipes.World.Models.BackendModels.Category;
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Favorit;
|
using Francesco.Recipes.World.Models.BackendModels.Favorit;
|
||||||
@@ -21,15 +21,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DbSet<Category> Categories => Set<Category>();
|
public DbSet<Category> Categories => Set<Category>();
|
||||||
|
|
||||||
public DbSet<Ingredient> Ingredients => Set<Ingredient>();
|
public DbSet<Ingredient> Ingredients => Set<Ingredient>();
|
||||||
|
|
||||||
public DbSet<Instruction> Instructions => Set<Instruction>();
|
public DbSet<Instruction> Instructions => Set<Instruction>();
|
||||||
|
|
||||||
public DbSet<Recipe> Recipes => Set<Recipe>();
|
public DbSet<Recipe> Recipes => Set<Recipe>();
|
||||||
|
|
||||||
public DbSet<RecipeIngredient> RecipeIngredients => Set<RecipeIngredient>();
|
public DbSet<RecipeIngredient> RecipeIngredients => Set<RecipeIngredient>();
|
||||||
|
|
||||||
public DbSet<Unit> Units => Set<Unit>();
|
public DbSet<Unit> Units => Set<Unit>();
|
||||||
|
|
||||||
public DbSet<Favorit> Favorits => Set<Favorit>();
|
public DbSet<Favorit> Favorits => Set<Favorit>();
|
||||||
|
|
||||||
public DbSet<IngredientsShoppingList> IngredientsShoppingLists => Set<IngredientsShoppingList>();
|
public DbSet<IngredientsShoppingList> IngredientsShoppingLists => Set<IngredientsShoppingList>();
|
||||||
|
|
||||||
public DbSet<ShoppingList> ShoppingLists => Set<ShoppingList>();
|
public DbSet<ShoppingList> ShoppingLists => Set<ShoppingList>();
|
||||||
|
|
||||||
public DbSet<MediaFile> MediaFiles => Set<MediaFile>();
|
public DbSet<MediaFile> MediaFiles => Set<MediaFile>();
|
||||||
|
|
||||||
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
|
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
foreach (var entry in ChangeTracker.Entries())
|
foreach (var entry in ChangeTracker.Entries())
|
||||||
@@ -104,4 +114,3 @@
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,10 +6,14 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<UserSecretsId>be6a70eb-b657-40b2-b4a1-418e5c6ec131</UserSecretsId>
|
<UserSecretsId>be6a70eb-b657-40b2-b4a1-418e5c6ec131</UserSecretsId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
<CodeAnalysisRuleSet>$(SolutionDir)Francesco.Recipes.World.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.11" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.11" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
|
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@@ -38,4 +42,11 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Controller\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AdditionalFiles Include=".\stylecop.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using System;
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||||
|
|
||||||
namespace Francesco.Recipes.World.Migrations
|
namespace Francesco.Recipes.World.Migrations
|
||||||
{
|
{
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class InitialMIgration : Migration
|
public partial class InitialMIgration : Migration
|
||||||
{
|
{
|
||||||
@@ -17,12 +17,13 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(migrationBuilder));
|
throw new ArgumentNullException(nameof(migrationBuilder));
|
||||||
}
|
}
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Categories",
|
name: "Categories",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -34,7 +35,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
|
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -46,7 +47,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -59,7 +60,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
ModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true)
|
ModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -72,7 +73,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
Symbol = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
Symbol = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -94,7 +95,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
ModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
ModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
FavoritId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
FavoritId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -118,7 +119,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
ShoppinglistId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
ShoppinglistId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
IngredientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
IngredientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -144,7 +145,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
Number = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
Number = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
RecipeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
RecipeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -165,7 +166,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
RecipeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
RecipeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
IngredientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
IngredientId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
UnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
Quantity = table.Column<int>(type: "int", nullable: false)
|
Quantity = table.Column<int>(type: "int", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -199,7 +200,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
MimeType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
MimeType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
Data = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
Data = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||||
RecipeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
RecipeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
InstructionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
InstructionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -231,7 +232,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{ new Guid("abbc6bb0-97ea-49f5-b31e-6507eb784fd1"), "Hauptgerichte" },
|
{ new Guid("abbc6bb0-97ea-49f5-b31e-6507eb784fd1"), "Hauptgerichte" },
|
||||||
{ new Guid("adfb75ce-3ef3-428b-a5ca-b0c4c619d5ec"), "Hefegebäck & Brot" },
|
{ new Guid("adfb75ce-3ef3-428b-a5ca-b0c4c619d5ec"), "Hefegebäck & Brot" },
|
||||||
{ new Guid("b248244f-f21c-4555-a14d-5dd49a2717cf"), "Vorspeisen & Snacks" },
|
{ new Guid("b248244f-f21c-4555-a14d-5dd49a2717cf"), "Vorspeisen & Snacks" },
|
||||||
{ new Guid("d332f88d-d241-48c5-a2f2-bfd124eada7e"), "Soßen & Saucen" }
|
{ new Guid("d332f88d-d241-48c5-a2f2-bfd124eada7e"), "Soßen & Saucen" },
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.InsertData(
|
migrationBuilder.InsertData(
|
||||||
@@ -249,7 +250,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{ new Guid("7ea2f51d-7493-4f19-a663-1f309186d3ae"), "bund", "bund" },
|
{ new Guid("7ea2f51d-7493-4f19-a663-1f309186d3ae"), "bund", "bund" },
|
||||||
{ new Guid("d82f4abd-e4e4-4104-a9c0-1acdeaa701f5"), "blatt", "blatt" },
|
{ new Guid("d82f4abd-e4e4-4104-a9c0-1acdeaa701f5"), "blatt", "blatt" },
|
||||||
{ new Guid("df5cb4c3-4de6-4c6f-be8c-da41b2986408"), "messerspitze", "msp" },
|
{ new Guid("df5cb4c3-4de6-4c6f-be8c-da41b2986408"), "messerspitze", "msp" },
|
||||||
{ new Guid("e45a3af2-2ed6-4ac4-b06f-b4175663a7be"), "stange", "stange" }
|
{ new Guid("e45a3af2-2ed6-4ac4-b06f-b4175663a7be"), "stange", "stange" },
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
@@ -310,6 +311,7 @@ namespace Francesco.Recipes.World.Migrations
|
|||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(migrationBuilder));
|
throw new ArgumentNullException(nameof(migrationBuilder));
|
||||||
}
|
}
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "IngredientsShoppingLists");
|
name: "IngredientsShoppingLists");
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
|
||||||
using Francesco.Recipes.World.Data;
|
using Francesco.Recipes.World.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
namespace Francesco.Recipes.World.Models.BackendModels.Category
|
namespace Francesco.Recipes.World.Models.BackendModels.Category
|
||||||
{
|
{
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
||||||
|
|
||||||
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; } = string.Empty;
|
||||||
|
|
||||||
public virtual ICollection<Recipe> Recipes { get; set; } = new List<Recipe>();
|
public virtual ICollection<Recipe> Recipes { get; set; } = new List<Recipe>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
public class Favorit
|
public class Favorit
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public DateTime CreatedAt { get; set; }
|
public DateTime CreatedAt { get; set; }
|
||||||
|
|
||||||
public virtual ICollection<Recipe> Recipe { get; set; } = new List<Recipe>();
|
public virtual ICollection<Recipe> Recipe { get; set; } = new List<Recipe>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,11 @@
|
|||||||
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; } = string.Empty;
|
||||||
|
|
||||||
public virtual ICollection<RecipeIngredient> RecipeIngredients { get; set; } = new List<RecipeIngredient>();
|
public virtual ICollection<RecipeIngredient> RecipeIngredients { get; set; } = new List<RecipeIngredient>();
|
||||||
|
|
||||||
public virtual ICollection<IngredientsShoppingList> IngredientShoppingLists { get; set; } = new List<IngredientsShoppingList>();
|
public virtual ICollection<IngredientsShoppingList> IngredientShoppingLists { get; set; } = new List<IngredientsShoppingList>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -6,7 +6,9 @@
|
|||||||
public class IngredientsShoppingList
|
public class IngredientsShoppingList
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public ShoppingList Shoppinglist { get; set; } = new ();
|
public ShoppingList Shoppinglist { get; set; } = new ();
|
||||||
|
|
||||||
public Ingredient Ingredient { 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.MediaFile;
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
||||||
|
|
||||||
public class Instruction
|
public class Instruction
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Description { get; set; }
|
|
||||||
public string Number { get; set; }
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int Number { get; set; }
|
||||||
|
|
||||||
public virtual Recipe Recipe { get; set; } = new ();
|
public virtual Recipe Recipe { get; set; } = new ();
|
||||||
|
|
||||||
public virtual ICollection<MediaFile> MediaFiles { get; set; } = new List<MediaFile>();
|
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.Instruction;
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
||||||
|
|
||||||
public class MediaFile
|
public class MediaFile
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; } = Guid.NewGuid();
|
public Guid Id { get; set; } = Guid.NewGuid();
|
||||||
@@ -11,7 +12,9 @@
|
|||||||
public string? MimeType { get; set; }
|
public string? MimeType { get; set; }
|
||||||
|
|
||||||
public byte[]? Data { get; set; }
|
public byte[]? Data { get; set; }
|
||||||
|
|
||||||
public virtual Recipe? Recipe { get; set; } = new ();
|
public virtual Recipe? Recipe { get; set; } = new ();
|
||||||
|
|
||||||
public virtual Instruction Instruction { get; set; } = new ();
|
public virtual Instruction Instruction { get; set; } = new ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,13 @@
|
|||||||
public enum Difficulty
|
public enum Difficulty
|
||||||
{
|
{
|
||||||
VeryEasy = 1,
|
VeryEasy = 1,
|
||||||
|
|
||||||
Easy = 2,
|
Easy = 2,
|
||||||
|
|
||||||
Medium = 3,
|
Medium = 3,
|
||||||
|
|
||||||
Hard = 4,
|
Hard = 4,
|
||||||
|
|
||||||
Expert = 5,
|
Expert = 5,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,17 +8,30 @@ using Francesco.Recipes.World.Models.BackendModels.RecipeIngredient;
|
|||||||
public class Recipe : ITimeStampedEntity
|
public class Recipe : ITimeStampedEntity
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Name { get; set; }
|
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
public Difficulty Difficulty { get; set; }
|
public Difficulty 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 bool IsFavorite { get; set; }
|
public bool IsFavorite { get; set; }
|
||||||
|
|
||||||
public DateTime CreatedAt { get; set; }
|
public DateTime CreatedAt { get; set; }
|
||||||
|
|
||||||
public DateTime? ModifiedAt { get; set; }
|
public DateTime? ModifiedAt { 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>();
|
||||||
|
|
||||||
public virtual ICollection<MediaFile> MediaFiles { get; set; } = new List<MediaFile>();
|
public virtual ICollection<MediaFile> MediaFiles { get; set; } = new List<MediaFile>();
|
||||||
|
|
||||||
public virtual Favorit Favorit { get; set; } = new ();
|
public virtual Favorit Favorit { get; set; } = new ();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,17 @@
|
|||||||
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
|
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Unit;
|
using Francesco.Recipes.World.Models.BackendModels.Unit;
|
||||||
|
|
||||||
public class RecipeIngredient
|
public class RecipeIngredient
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public virtual Recipe Recipe { get; set; } = new ();
|
public virtual Recipe Recipe { get; set; } = new ();
|
||||||
|
|
||||||
public virtual Ingredient Ingredient { get; set; } = new ();
|
public virtual Ingredient Ingredient { get; set; } = new ();
|
||||||
|
|
||||||
public virtual Unit Unit { get; set; } = new ();
|
public virtual Unit Unit { get; set; } = new ();
|
||||||
|
|
||||||
public int Quantity { get; set; }
|
public int Quantity { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
using Francesco.Recipes.World.Models.BackendModels.IngredientShoppingList;
|
namespace Francesco.Recipes.World.Models.BackendModels.Shoppinglist
|
||||||
|
|
||||||
namespace Francesco.Recipes.World.Models.BackendModels.Shoppinglist
|
|
||||||
{
|
{
|
||||||
|
using Francesco.Recipes.World.Models.BackendModels.IngredientShoppingList;
|
||||||
|
|
||||||
public class ShoppingList : ITimeStampedEntity
|
public class ShoppingList : ITimeStampedEntity
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public DateTime CreatedAt { get; set; }
|
public DateTime CreatedAt { get; set; }
|
||||||
|
|
||||||
public DateTime? ModifiedAt { get; set; }
|
public DateTime? ModifiedAt { get; set; }
|
||||||
|
|
||||||
public virtual ICollection<IngredientsShoppingList> IngredientsShoppingLists { get; set; } = new List<IngredientsShoppingList>();
|
public virtual ICollection<IngredientsShoppingList> IngredientsShoppingLists { get; set; } = new List<IngredientsShoppingList>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
|
namespace Francesco.Recipes.World.Models.BackendModels.Unit
|
||||||
|
|
||||||
namespace Francesco.Recipes.World.Models.BackendModels.Unit
|
|
||||||
{
|
{
|
||||||
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
|
|
||||||
using Francesco.Recipes.World.Models.BackendModels.RecipeIngredient;
|
using Francesco.Recipes.World.Models.BackendModels.RecipeIngredient;
|
||||||
|
|
||||||
public class Unit
|
public class Unit
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Name { get; set; }
|
|
||||||
public string Symbol { 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>();
|
public virtual ICollection<RecipeIngredient> RecipeIngredient { get; set; } = new List<RecipeIngredient>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
using Francesco.Recipes.World.Data;
|
using Francesco.Recipes.World.Data;
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Serilog;
|
|
||||||
|
|
||||||
|
using Francesco.Recipes.World.Repositories;
|
||||||
|
|
||||||
|
using FrancescoRecipesWorld.Repositories;
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
var services = builder.Services;
|
var services = builder.Services;
|
||||||
|
|
||||||
var configuration = builder.Configuration;
|
var configuration = builder.Configuration;
|
||||||
|
|
||||||
var connectionString = builder.Configuration.GetConnectionString("FrancescosRecipesWorldDbContextConnection")
|
var connectionString = builder.Configuration.GetConnectionString("FrancescosRecipesWorldDbContextConnection")
|
||||||
?? throw new InvalidOperationException("Connection string 'FrancescosRecipesWorldDbContextConnection' not found.");
|
?? throw new InvalidOperationException("Connection string 'FrancescosRecipesWorldDbContextConnection' not found.");
|
||||||
|
|
||||||
services.AddDbContext<FrancescosRecipesWorldDbContext>(options =>
|
services.AddDbContext<FrancescosRecipesWorldDbContext>(options =>
|
||||||
options.UseSqlServer(connectionString));
|
options.UseSqlServer(connectionString));
|
||||||
|
|
||||||
@@ -19,6 +26,14 @@ services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfi
|
|||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<IRecipeRepository, RecipeRepository>();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<IIngredientRepository, IngredientRepository>();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<IUnitRepository, UnitRepository>();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<ICategoryRepository, CategoryRepository>();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
@@ -31,9 +46,11 @@ if (!app.Environment.IsDevelopment())
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|||||||
Reference in New Issue
Block a user