Merged PR 7: dotnet version change, readme, script for ef

dotnet version change, readme, script for ef
This commit is contained in:
Dominic Villemure
2024-03-16 18:05:11 +00:00
7 changed files with 34 additions and 15 deletions

View File

@@ -19,6 +19,10 @@
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />

1
Ef.ps1 Normal file
View File

@@ -0,0 +1 @@
dotnet ef $args --startup-project ./src/Web/Web.csproj --project ./src/Infrastructure/Infrastructure.csproj

View File

@@ -1,8 +1,10 @@
# Hutopy
## Pattern used
- Clean Architecture
## Patterns / strategy used
- Clean Architecture ( with Infrastructure, Domain, Application and Web layers )
- Minimal API endpoints.
- Guards ( Fail fast ) : https://github.com/ardalis/GuardClauses
-
## Tools
- Install Docker : https://www.docker.com/get-started/

View File

@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "8.0.203",
"rollForward": "latestFeature"
}
}

View File

@@ -28,7 +28,6 @@ public static class DependencyInjection
services.AddDbContext<ApplicationDbContext>((sp, options) =>
{
options.AddInterceptors(sp.GetServices<ISaveChangesInterceptor>());
options.UseSqlServer(connectionString);
});
@@ -41,6 +40,7 @@ public static class DependencyInjection
services.AddAuthorizationBuilder();
// Might need to change and use AddIdentity<User, Role>() when we need to integrate connection via third party ( facebook, google )
services
.AddIdentityCore<ApplicationUser>()
.AddRoles<IdentityRole>()

View File

@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Hutopy.Infrastructure</RootNamespace>
<AssemblyName>Hutopy.Infrastructure</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore"/>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Application\Application.csproj" />
<ProjectReference Include="..\Application\Application.csproj"/>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.3",
"commands": [
"dotnet-ef"
]
}
}
}