diff --git a/.github/workflows/dotnet-format-action.yml b/.github/workflows/dotnet-format-action.yml index db5683a..4ed6651 100644 --- a/.github/workflows/dotnet-format-action.yml +++ b/.github/workflows/dotnet-format-action.yml @@ -13,7 +13,9 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x - name: Install Android run: dotnet workload install android - name: Run dotnet format @@ -25,7 +27,9 @@ jobs: workspace: "./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln" - name: Test run: | + dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f net6.0 dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f net7.0 + dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f net8.0 - name: Commit files if: steps.format.outputs.has-changes == 'true' uses: EndBug/add-and-commit@v4.1.0 diff --git a/.github/workflows/dotnet-linux-client.yml b/.github/workflows/dotnet-linux-client.yml index fc7a249..aefbf19 100644 --- a/.github/workflows/dotnet-linux-client.yml +++ b/.github/workflows/dotnet-linux-client.yml @@ -15,7 +15,9 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x - name: Restore dependencies run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln - name: Build diff --git a/.github/workflows/dotnet-linux.yml b/.github/workflows/dotnet-linux.yml index ddde6b8..0572e6c 100644 --- a/.github/workflows/dotnet-linux.yml +++ b/.github/workflows/dotnet-linux.yml @@ -15,11 +15,15 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x - name: Restore dependencies run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln - name: Build run: dotnet build ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-restore - name: Test run: | + dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net6.0 dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net7.0 + dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net8.0 diff --git a/.github/workflows/dotnet-macos-client.yml b/.github/workflows/dotnet-macos-client.yml index be9612f..db69924 100644 --- a/.github/workflows/dotnet-macos-client.yml +++ b/.github/workflows/dotnet-macos-client.yml @@ -15,7 +15,9 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x - name: Restore dependencies run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln - name: Build diff --git a/.github/workflows/dotnet-macos.yml b/.github/workflows/dotnet-macos.yml index 7b197cc..53fd6e2 100644 --- a/.github/workflows/dotnet-macos.yml +++ b/.github/workflows/dotnet-macos.yml @@ -15,11 +15,15 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x - name: Restore dependencies run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln - name: Build run: dotnet build ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-restore - name: Test run: | + dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net6.0 dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net7.0 + dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net8.0 diff --git a/.github/workflows/dotnet-windows-client.yml b/.github/workflows/dotnet-windows-client.yml index f37004c..e1bc027 100644 --- a/.github/workflows/dotnet-windows-client.yml +++ b/.github/workflows/dotnet-windows-client.yml @@ -19,6 +19,7 @@ jobs: 5.0.x 6.0.x 7.0.x + 8.0.x - name: Restore dependencies run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln - name: Build diff --git a/.github/workflows/dotnet-windows.yml b/.github/workflows/dotnet-windows.yml index b20a12d..1f78725 100644 --- a/.github/workflows/dotnet-windows.yml +++ b/.github/workflows/dotnet-windows.yml @@ -15,7 +15,9 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x - name: Restore dependencies run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln - name: Build diff --git a/.github/workflows/nuget-push-public-client.yml b/.github/workflows/nuget-push-public-client.yml index 8958f59..077fe2c 100644 --- a/.github/workflows/nuget-push-public-client.yml +++ b/.github/workflows/nuget-push-public-client.yml @@ -10,7 +10,9 @@ jobs: - uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x env: DOTNET_INSTALL_DIR: /usr/share/dotnet - name: Restore dependencies diff --git a/.github/workflows/nuget-push-public.yml b/.github/workflows/nuget-push-public.yml index 3530e63..4913711 100644 --- a/.github/workflows/nuget-push-public.yml +++ b/.github/workflows/nuget-push-public.yml @@ -10,7 +10,9 @@ jobs: - uses: actions/setup-dotnet@v3 with: dotnet-version: | + 6.0.x 7.0.x + 8.0.x env: DOTNET_INSTALL_DIR: /usr/share/dotnet - name: Restore dependencies diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Builders/AuthenticationDatabaseBuilder.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Builders/AuthenticationDatabaseBuilder.cs new file mode 100644 index 0000000..cdbf71b --- /dev/null +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Builders/AuthenticationDatabaseBuilder.cs @@ -0,0 +1,73 @@ +using EasyMicroservices.AuthenticationsMicroservice.Database.Entities; +using EasyMicroservices.AuthenticationsMicroservice.SeedData; +using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Builders; +using Microsoft.EntityFrameworkCore; + +namespace EasyMicroservices.AuthenticationsMicroservice.Database.Builders; + +public class AuthenticationDatabaseBuilder +{ + public void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(model => + { + model.HasIndex(u => new { u.BusinessUniqueIdentity, u.UserName }) + .IsUnique(); + model.ToTable("Users"); + }); + + modelBuilder.Entity(model => + { + model.HasKey(u => new { u.RoleId, u.ServicePermissionId }); + model.ToTable("RoleServicePermissions"); + }); + + modelBuilder.Entity(model => + { + model.HasKey(u => new { u.RoleId, u.UserId }); + model.ToTable("UserRoles"); + }); + + modelBuilder.Entity(model => + { + model.HasIndex(u => u.MicroserviceName); + model.HasIndex(u => u.ServiceName); + model.HasIndex(u => u.MethodName); + model.HasIndex(u => new { u.MicroserviceName, u.ServiceName, u.MethodName }).IsUnique(); + model.ToTable("ServicePermissions"); + }); + + modelBuilder.Entity(model => + { + model.HasKey(u => new { u.ParentId, u.ChildId }); + + model.HasOne(u => u.Parent) + .WithMany(u => u.Parents) + .HasForeignKey(u => u.ParentId) + .OnDelete(DeleteBehavior.Restrict); + + model.HasOne(u => u.Child) + .WithMany(u => u.Children) + .HasForeignKey(u => u.ChildId) + .OnDelete(DeleteBehavior.Restrict); + model.ToTable("RoleParentChildren"); + }); + + modelBuilder.Entity(model => + { + model.ToTable("Roles"); + }); + + modelBuilder.Entity(model => + { + model.ToTable("PersonalAccessTokens"); + }); + + modelBuilder.Entity(model => + { + model.ToTable("RegisterUserDefaultRoles"); + }); + + var result = new RelationalCoreModelBuilder().AutoModelCreating(modelBuilder); + } +} diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Contexts/AuthenticationsContext.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Contexts/AuthenticationsContext.cs index 6b4c56d..4dadbed 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Contexts/AuthenticationsContext.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/Database/Contexts/AuthenticationsContext.cs @@ -1,4 +1,5 @@ -using EasyMicroservices.AuthenticationsMicroservice.Database.Entities; +using EasyMicroservices.AuthenticationsMicroservice.Database.Builders; +using EasyMicroservices.AuthenticationsMicroservice.Database.Entities; using EasyMicroservices.AuthenticationsMicroservice.SeedData; using EasyMicroservices.Cores.Relational.EntityFrameworkCore; using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces; @@ -23,47 +24,9 @@ public AuthenticationsContext(IEntityFrameworkCoreDatabaseBuilder builder) : bas protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder.Entity(model => - { - model.HasIndex(u => new { u.BusinessUniqueIdentity, u.UserName }) - .IsUnique(); - }); - - modelBuilder.Entity(model => - { - model.HasKey(u => new { u.RoleId, u.ServicePermissionId }); - }); - - modelBuilder.Entity(model => - { - model.HasKey(u => new { u.RoleId, u.UserId }); - }); - - modelBuilder.Entity(model => - { - model.HasIndex(u => u.MicroserviceName); - model.HasIndex(u => u.ServiceName); - model.HasIndex(u => u.MethodName); - model.HasIndex(u => new { u.MicroserviceName, u.ServiceName, u.MethodName }).IsUnique(); - }); - - modelBuilder.Entity(model => - { - model.HasKey(u => new { u.ParentId, u.ChildId }); - - model.HasOne(u => u.Parent) - .WithMany(u => u.Parents) - .HasForeignKey(u => u.ParentId) - .OnDelete(DeleteBehavior.Restrict); - - model.HasOne(u => u.Child) - .WithMany(u => u.Children) - .HasForeignKey(u => u.ChildId) - .OnDelete(DeleteBehavior.Restrict); - }); - + new AuthenticationDatabaseBuilder().OnModelCreating(modelBuilder); var result = base.AutoModelCreating(modelBuilder); - AllSeedData.Seed(modelBuilder); + AuthenticationsSeedData.Seed(modelBuilder); } } } \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/EasyMicroservices.AuthenticationsMicroservice.Database.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/EasyMicroservices.AuthenticationsMicroservice.Database.csproj index e4b3db9..d0745ec 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/EasyMicroservices.AuthenticationsMicroservice.Database.csproj +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/EasyMicroservices.AuthenticationsMicroservice.Database.csproj @@ -1,8 +1,17 @@  - + - net7.0 + net6.0;net7.0;net8.0 + AnyCPU;x64;x86 + EasyMicroservices + 0.0.0.1 + Authentications Microservice + EasyMicroservices@gmail.com + module,database,services,asp,aspnet,auth,authentication,authentications + https://github.com/EasyMicroservices/Cores + latest EasyMicroservices.AuthenticationsMicroservice + true diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/SeedData/AllSeedData.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/SeedData/AuthenticationsSeedData.cs similarity index 99% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/SeedData/AllSeedData.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/SeedData/AuthenticationsSeedData.cs index 8b60df4..f112beb 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/SeedData/AllSeedData.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Database/SeedData/AuthenticationsSeedData.cs @@ -5,7 +5,7 @@ namespace EasyMicroservices.AuthenticationsMicroservice.SeedData { - public static class AllSeedData + public static class AuthenticationsSeedData { public static void Seed(ModelBuilder modelBuilder) { diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Domain/EasyMicroservices.AuthenticationsMicroservice.Domain.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Domain/EasyMicroservices.AuthenticationsMicroservice.Domain.csproj index 562a180..2bce848 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Domain/EasyMicroservices.AuthenticationsMicroservice.Domain.csproj +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Domain/EasyMicroservices.AuthenticationsMicroservice.Domain.csproj @@ -1,16 +1,25 @@  - + - net7.0 + net6.0;net7.0;net8.0 + AnyCPU;x64;x86 + EasyMicroservices + 0.0.0.1 + Authentications Microservice + EasyMicroservices@gmail.com + module,domain,services,asp,aspnet,auth,authentication,authentications + https://github.com/EasyMicroservices/Cores + latest EasyMicroservices.AuthenticationsMicroservice + true - + - + diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Logics/EasyMicroservices.AuthenticationsMicroservice.Logics.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Logics/EasyMicroservices.AuthenticationsMicroservice.Logics.csproj index 90dc237..4270d04 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Logics/EasyMicroservices.AuthenticationsMicroservice.Logics.csproj +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Logics/EasyMicroservices.AuthenticationsMicroservice.Logics.csproj @@ -1,8 +1,17 @@  - + - net7.0 + net6.0;net7.0;net8.0 + AnyCPU;x64;x86 + EasyMicroservices + 0.0.0.1 + Authentications Microservice + EasyMicroservices@gmail.com + module,logics,asp,aspnet,auth,authentication,authentications + https://github.com/EasyMicroservices/Cores + latest EasyMicroservices.AuthenticationsMicroservice + true diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/PersonalAccessTokenController.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/PersonalAccessTokenController.cs similarity index 100% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/PersonalAccessTokenController.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/PersonalAccessTokenController.cs diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/RoleController.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/RoleController.cs similarity index 96% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/RoleController.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/RoleController.cs index 440f779..8d32841 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/RoleController.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/RoleController.cs @@ -2,12 +2,13 @@ using EasyMicroservices.AuthenticationsMicroservice.Contracts.Requests; using EasyMicroservices.AuthenticationsMicroservice.Database.Entities; using EasyMicroservices.Cores.AspCoreApi; -using EasyMicroservices.Cores.Contracts.Requests; using EasyMicroservices.Cores.Interfaces; using EasyMicroservices.ServiceContracts; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using System.Linq; +using System.Threading.Tasks; namespace EasyMicroservices.AuthenticationsMicroservice.WebApi.Controllers { diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/RoleServicePermissionController.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/RoleServicePermissionController.cs similarity index 100% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/RoleServicePermissionController.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/RoleServicePermissionController.cs diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/ServicePermissionController.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/ServicePermissionController.cs similarity index 96% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/ServicePermissionController.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/ServicePermissionController.cs index 535ce53..941c22c 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/ServicePermissionController.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/ServicePermissionController.cs @@ -7,7 +7,12 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; using System.Text; +using System.Threading; +using System.Threading.Tasks; namespace EasyMicroservices.AuthenticationsMicroservice.WebApi.Controllers { diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/UserController.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/UserController.cs similarity index 94% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/UserController.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/UserController.cs index c11f440..87b3b89 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/UserController.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/UserController.cs @@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; namespace EasyMicroservices.AuthenticationsMicroservice.WebApi.Controllers { @@ -33,7 +36,8 @@ public override async Task> Add(AddUserRequestContract req var roles = await UnitOfWork.GetLogic().AddBulk(defaultRoles.Select(x => new UserRoleEntity() { RoleId = x.RoleId, - UserId = userId + UserId = userId, + UniqueIdentity = request.UniqueIdentity }).ToList()).AsCheckedResult(); } return userId; diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/UserRoleController.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/UserRoleController.cs similarity index 100% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Controllers/UserRoleController.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/Controllers/UserRoleController.cs diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/EasyMicroservices.AuthenticationsMicroservice.Module.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/EasyMicroservices.AuthenticationsMicroservice.Module.csproj new file mode 100644 index 0000000..c463147 --- /dev/null +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Module/EasyMicroservices.AuthenticationsMicroservice.Module.csproj @@ -0,0 +1,20 @@ + + + + net6.0;net7.0;net8.0 + AnyCPU;x64;x86 + EasyMicroservices + 0.0.0.1 + Authentications Microservice + EasyMicroservices@gmail.com + module,services,asp,aspnet,auth,authentication,authentications + https://github.com/EasyMicroservices/Cores + latest + true + + + + + + + diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Services/EasyMicroservices.AuthenticationsMicroservice.Services.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Services/EasyMicroservices.AuthenticationsMicroservice.Services.csproj deleted file mode 100644 index 6a0f8ae..0000000 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Services/EasyMicroservices.AuthenticationsMicroservice.Services.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net7.0 - EasyMicroservices.AuthenticationsMicroservice - - - - - - - - - - - - - - diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.StartUp/EasyMicroservices.AuthenticationsMicroservice.StartUp.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.StartUp/EasyMicroservices.AuthenticationsMicroservice.StartUp.csproj deleted file mode 100644 index 4fbe88f..0000000 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.StartUp/EasyMicroservices.AuthenticationsMicroservice.StartUp.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net7.0 - EasyMicroservices.AuthenticationsMicroservice - - - - - - - - - - - - - diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.StartUp/DatabaseBuilder.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/DatabaseBuilder.cs similarity index 91% rename from src/CSharp/EasyMicroservices.AuthenticationsMicroservice.StartUp/DatabaseBuilder.cs rename to src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/DatabaseBuilder.cs index 0b933c4..6a9a903 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.StartUp/DatabaseBuilder.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/DatabaseBuilder.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; -namespace EasyMicroservices.AuthenticationsMicroservice +namespace EasyMicroservices.AuthenticationsMicroservice.WebApi { public class DatabaseBuilder : EntityFrameworkCoreDatabaseBuilder { diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/EasyMicroservices.AuthenticationsMicroservice.WebApi.csproj b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/EasyMicroservices.AuthenticationsMicroservice.WebApi.csproj index f1e1c49..f876635 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/EasyMicroservices.AuthenticationsMicroservice.WebApi.csproj +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/EasyMicroservices.AuthenticationsMicroservice.WebApi.csproj @@ -8,6 +8,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -19,7 +20,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Program.cs b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Program.cs index 5265ce5..36e819c 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Program.cs +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/Program.cs @@ -1,7 +1,9 @@ using EasyMicroservices.AuthenticationsMicroservice.Database.Contexts; +using EasyMicroservices.AuthenticationsMicroservice.WebApi.Controllers; using EasyMicroservices.Cores.AspEntityFrameworkCoreApi; using EasyMicroservices.Cores.Interfaces; using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces; +using Microsoft.AspNetCore.Mvc.ApplicationParts; namespace EasyMicroservices.AuthenticationsMicroservice.WebApi { @@ -23,6 +25,8 @@ static WebApplicationBuilder CreateBuilder(string[] args) app.Services.AddTransient(serviceProvider => new AuthenticationsContext(serviceProvider.GetService())); app.Services.AddTransient(); app.Services.AddTransient(); + app.Services.AddMvc() + .AddApplicationPart(typeof(RoleController).Assembly); return app; } diff --git a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln index a9ef1ac..b42985c 100644 --- a/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln +++ b/src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln @@ -15,10 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.Authentic EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.AuthenticationsMicroservice.Logics", "EasyMicroservices.AuthenticationsMicroservice.Logics\EasyMicroservices.AuthenticationsMicroservice.Logics.csproj", "{19CB83B3-9617-469C-A064-6619A752630F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.AuthenticationsMicroservice.Services", "EasyMicroservices.AuthenticationsMicroservice.Services\EasyMicroservices.AuthenticationsMicroservice.Services.csproj", "{90E40B3E-1DBA-4B5B-A30B-A77B0C428012}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.AuthenticationsMicroservice.StartUp", "EasyMicroservices.AuthenticationsMicroservice.StartUp\EasyMicroservices.AuthenticationsMicroservice.StartUp.csproj", "{1C645056-B212-44F1-8180-06DC5C06700D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.AuthenticationsMicroservice.Database", "EasyMicroservices.AuthenticationsMicroservice.Database\EasyMicroservices.AuthenticationsMicroservice.Database.csproj", "{0870D7AE-CE25-4292-9187-A3E231057FD2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.AuthenticationsMicroservice.Domain", "EasyMicroservices.AuthenticationsMicroservice.Domain\EasyMicroservices.AuthenticationsMicroservice.Domain.csproj", "{03185D3C-E3B7-4577-9E9E-3919528C6CE8}" @@ -27,6 +23,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.Authentic EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.AuthenticationsMicroservic.ConsoleApp", "EasyMicroservices.AuthenticationsMicroservice.ConsoleApp\EasyMicroservices.AuthenticationsMicroservic.ConsoleApp.csproj", "{1F823EAD-51B0-465D-87A8-C64F699B513F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyMicroservices.AuthenticationsMicroservice.Module", "EasyMicroservices.AuthenticationsMicroservice.Module\EasyMicroservices.AuthenticationsMicroservice.Module.csproj", "{06BB892C-3B9D-4217-8133-4B7A3001B110}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,30 +59,6 @@ Global {19CB83B3-9617-469C-A064-6619A752630F}.Release|x64.Build.0 = Release|Any CPU {19CB83B3-9617-469C-A064-6619A752630F}.Release|x86.ActiveCfg = Release|Any CPU {19CB83B3-9617-469C-A064-6619A752630F}.Release|x86.Build.0 = Release|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Debug|x64.ActiveCfg = Debug|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Debug|x64.Build.0 = Debug|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Debug|x86.ActiveCfg = Debug|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Debug|x86.Build.0 = Debug|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Release|Any CPU.Build.0 = Release|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Release|x64.ActiveCfg = Release|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Release|x64.Build.0 = Release|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Release|x86.ActiveCfg = Release|Any CPU - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012}.Release|x86.Build.0 = Release|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Debug|x64.ActiveCfg = Debug|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Debug|x64.Build.0 = Debug|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Debug|x86.ActiveCfg = Debug|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Debug|x86.Build.0 = Debug|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Release|Any CPU.Build.0 = Release|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Release|x64.ActiveCfg = Release|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Release|x64.Build.0 = Release|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Release|x86.ActiveCfg = Release|Any CPU - {1C645056-B212-44F1-8180-06DC5C06700D}.Release|x86.Build.0 = Release|Any CPU {0870D7AE-CE25-4292-9187-A3E231057FD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0870D7AE-CE25-4292-9187-A3E231057FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU {0870D7AE-CE25-4292-9187-A3E231057FD2}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -133,6 +107,18 @@ Global {1F823EAD-51B0-465D-87A8-C64F699B513F}.Release|x64.Build.0 = Release|Any CPU {1F823EAD-51B0-465D-87A8-C64F699B513F}.Release|x86.ActiveCfg = Release|Any CPU {1F823EAD-51B0-465D-87A8-C64F699B513F}.Release|x86.Build.0 = Release|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Debug|x64.ActiveCfg = Debug|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Debug|x64.Build.0 = Debug|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Debug|x86.ActiveCfg = Debug|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Debug|x86.Build.0 = Debug|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Release|Any CPU.Build.0 = Release|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Release|x64.ActiveCfg = Release|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Release|x64.Build.0 = Release|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Release|x86.ActiveCfg = Release|Any CPU + {06BB892C-3B9D-4217-8133-4B7A3001B110}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -140,12 +126,11 @@ Global GlobalSection(NestedProjects) = preSolution {96989D74-1B60-4E56-B4AA-207040490549} = {5095A63E-0C95-4352-8E6B-4586A9340BFB} {19CB83B3-9617-469C-A064-6619A752630F} = {AAC7D1B4-C636-471D-8894-B1FA3D7995FB} - {90E40B3E-1DBA-4B5B-A30B-A77B0C428012} = {AAC7D1B4-C636-471D-8894-B1FA3D7995FB} - {1C645056-B212-44F1-8180-06DC5C06700D} = {AAC7D1B4-C636-471D-8894-B1FA3D7995FB} {0870D7AE-CE25-4292-9187-A3E231057FD2} = {DD5CE7AE-185C-4AB5-A7AD-9CCB6051E804} {03185D3C-E3B7-4577-9E9E-3919528C6CE8} = {DD5CE7AE-185C-4AB5-A7AD-9CCB6051E804} {17F6EED5-B82F-4A76-AEDF-4B3169CC5A9B} = {2A1A75C2-9A91-4588-9ADD-046CB14463CA} {1F823EAD-51B0-465D-87A8-C64F699B513F} = {5095A63E-0C95-4352-8E6B-4586A9340BFB} + {06BB892C-3B9D-4217-8133-4B7A3001B110} = {AAC7D1B4-C636-471D-8894-B1FA3D7995FB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B8B82934-7EE0-4C86-9065-ADF9092553E1}