From 796d60a410bbf2b9c4bc624685fdba621e70431c Mon Sep 17 00:00:00 2001 From: Dominic Villemure Date: Sat, 16 Mar 2024 13:26:29 -0400 Subject: [PATCH 1/2] dotnet version change, readme, script for ef --- Directory.Packages.props | 28 +++++++++++++---------- Ef.ps1 | 1 + README.md | 6 +++-- global.json | 2 +- src/Infrastructure/DependencyInjection.cs | 2 +- src/Infrastructure/Infrastructure.csproj | 22 +++++++++--------- src/Web/.config/dotnet-tools.json | 12 ++++++++++ 7 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 Ef.ps1 create mode 100644 src/Web/.config/dotnet-tools.json diff --git a/Directory.Packages.props b/Directory.Packages.props index 864c732..ba78a5d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,18 +13,22 @@ - - - - - - - - - - - - + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + diff --git a/Ef.ps1 b/Ef.ps1 new file mode 100644 index 0000000..da8240b --- /dev/null +++ b/Ef.ps1 @@ -0,0 +1 @@ +dotnet ef $args --startup-project ./src/Web/Web.csproj --project ./src/Infrastructure/Infrastructure.csproj \ No newline at end of file diff --git a/README.md b/README.md index 2c86832..3c9281a 100644 --- a/README.md +++ b/README.md @@ -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/ diff --git a/global.json b/global.json index 501e79a..4e08f95 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.300", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/src/Infrastructure/DependencyInjection.cs b/src/Infrastructure/DependencyInjection.cs index 3a2b7a8..f466e8f 100644 --- a/src/Infrastructure/DependencyInjection.cs +++ b/src/Infrastructure/DependencyInjection.cs @@ -28,7 +28,6 @@ public static class DependencyInjection services.AddDbContext((sp, options) => { options.AddInterceptors(sp.GetServices()); - options.UseSqlServer(connectionString); }); @@ -41,6 +40,7 @@ public static class DependencyInjection services.AddAuthorizationBuilder(); + // Might need to change and use AddIdentity() when we need to integrate connection via third party ( facebook, google ) services .AddIdentityCore() .AddRoles() diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj index f68f7c8..581d24f 100644 --- a/src/Infrastructure/Infrastructure.csproj +++ b/src/Infrastructure/Infrastructure.csproj @@ -1,20 +1,20 @@ - - + Hutopy.Infrastructure Hutopy.Infrastructure - - - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + - - + - diff --git a/src/Web/.config/dotnet-tools.json b/src/Web/.config/dotnet-tools.json new file mode 100644 index 0000000..d9d129c --- /dev/null +++ b/src/Web/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "8.0.3", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file From 954dc6c2c851667901222b6e449e41f0ed771e8c Mon Sep 17 00:00:00 2001 From: Dominic Villemure Date: Sat, 16 Mar 2024 13:56:53 -0400 Subject: [PATCH 2/2] Fix versions --- Directory.Packages.props | 26 +++++++++++++------------- global.json | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ba78a5d..0db7a9f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,22 +13,22 @@ - - - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - + + + + + + diff --git a/global.json b/global.json index 4e08f95..282c5a8 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.300", + "version": "8.0.203", "rollForward": "latestFeature" } } \ No newline at end of file