From d1dbe6209c49a319d47c2c73e5d593894d486fb4 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli Date: Fri, 13 Feb 2026 00:38:09 +0330 Subject: [PATCH 1/4] feat: update packages to .net 10 --- Directory.Build.props | 17 +- global.json | 2 +- src/ApiGateway/src/Program.cs | 1 + src/Aspire/src/AppHost/AppHost.csproj | 18 +-- .../ServiceDefaults/ServiceDefaults.csproj | 2 +- src/BuildingBlocks/BuildingBlocks.csproj | 152 +++++++++--------- .../SecuritySchemeDocumentTransformer.cs | 57 ++++--- .../OpenTelemetryCollector/Extensions.cs | 5 +- src/BuildingBlocks/TestBase/TestBase.cs | 36 +++-- .../Booking/src/Booking/Booking.csproj | 2 +- .../InfrastructureExtensions.cs | 1 + .../Booking/Features/CreateBookingTests.cs | 2 +- .../IntegrationTest/Integration.Test.csproj | 6 +- .../InfrastructureExtensions.cs | 1 + src/Services/Flight/src/Flight/Flight.csproj | 8 +- .../tests/EndToEndTest/EndToEnd.Test.csproj | 6 +- .../Features/GetAvailableFlightsTests.cs | 2 +- .../IntegrationTest/Integration.Test.csproj | 6 +- .../Seat/Features/GetAvailableSeatsTests.cs | 2 +- .../Flight/tests/UnitTest/Unit.Test.csproj | 6 +- .../InfrastructureExtensions.cs | 1 + .../Identity/src/Identity/Identity.csproj | 2 +- .../IntegrationTest/Integration.Test.csproj | 6 +- .../InfrastructureExtensions.cs | 1 + .../Passenger/src/Passenger/Passenger.csproj | 4 +- .../IntegrationTest/Integration.Test.csproj | 6 +- .../CompleteRegisterPassengerTests.cs | 2 - 27 files changed, 187 insertions(+), 167 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index b19e86e..f7b3371 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable enable @@ -10,25 +10,22 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive - - runtime; build; native; contentfiles; analyzers; buildtransitive - - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/global.json b/global.json index ccd7812..77d642b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "10.0.103", "rollForward": "latestFeature" } } diff --git a/src/ApiGateway/src/Program.cs b/src/ApiGateway/src/Program.cs index a61bf0d..e07397c 100644 --- a/src/ApiGateway/src/Program.cs +++ b/src/ApiGateway/src/Program.cs @@ -1,5 +1,6 @@ using BuildingBlocks.Web; using Figgle; +using Figgle.Fonts; var builder = WebApplication.CreateBuilder(args); var env = builder.Environment; diff --git a/src/Aspire/src/AppHost/AppHost.csproj b/src/Aspire/src/AppHost/AppHost.csproj index 3cb0678..77d8920 100644 --- a/src/Aspire/src/AppHost/AppHost.csproj +++ b/src/Aspire/src/AppHost/AppHost.csproj @@ -1,10 +1,10 @@ - + Exe - net9.0 + net10.0 enable enable true @@ -12,13 +12,13 @@ - - - - - - - + + + + + + + diff --git a/src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj b/src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj index fb67635..fb9e6be 100644 --- a/src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj +++ b/src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable diff --git a/src/BuildingBlocks/BuildingBlocks.csproj b/src/BuildingBlocks/BuildingBlocks.csproj index 97293ac..be4df11 100644 --- a/src/BuildingBlocks/BuildingBlocks.csproj +++ b/src/BuildingBlocks/BuildingBlocks.csproj @@ -3,69 +3,69 @@ - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - + + @@ -74,34 +74,34 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - - - - - + + + + + + - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs b/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs index 94d3f39..6f5ffc7 100644 --- a/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs +++ b/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs @@ -1,5 +1,5 @@ using Microsoft.AspNetCore.OpenApi; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; public class SecuritySchemeDocumentTransformer : IOpenApiDocumentTransformer { @@ -9,35 +9,40 @@ public class SecuritySchemeDocumentTransformer : IOpenApiDocumentTransformer CancellationToken cancellationToken ) { - document.Components ??= new(); + document.Components ??= new OpenApiComponents(); - // Bearer token scheme - document.Components.SecuritySchemes.Add( - "Bearer", - new OpenApiSecurityScheme - { - Name = "Authorization", - Type = SecuritySchemeType.Http, - Scheme = "bearer", - BearerFormat = "JWT", - In = ParameterLocation.Header, - Description = - "Enter 'Bearer' [space] and your token in the text input below.\n\nExample: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'", - } - ); + // Initialize with the correct interface type + document.Components.SecuritySchemes ??= new Dictionary(); - // API Key scheme - document.Components.SecuritySchemes.Add( - "ApiKey", - new OpenApiSecurityScheme + var securitySchemes = new Dictionary + { + ["Bearer"] = new OpenApiSecurityScheme + { + Name = "Authorization", + Type = SecuritySchemeType.Http, + Scheme = "bearer", + BearerFormat = "JWT", + In = ParameterLocation.Header, + Description = + "Enter 'Bearer' [space] and your token in the text input below.\n\nExample: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'", + }, + ["ApiKey"] = new OpenApiSecurityScheme + { + Name = "X-API-KEY", + Type = SecuritySchemeType.ApiKey, + In = ParameterLocation.Header, + Description = + "Enter your API key in the text input below.\n\nExample: '12345-abcdef'", + }, + }; + + foreach (var (key, scheme) in securitySchemes) + { + if (!document.Components.SecuritySchemes.ContainsKey(key)) { - Name = "X-API-KEY", - Type = SecuritySchemeType.ApiKey, - In = ParameterLocation.Header, - Description = - "Enter your API key in the text input below.\n\nExample: '12345-abcdef'", + document.Components.SecuritySchemes.Add(key, scheme); } - ); + } return Task.CompletedTask; } diff --git a/src/BuildingBlocks/OpenTelemetryCollector/Extensions.cs b/src/BuildingBlocks/OpenTelemetryCollector/Extensions.cs index aab72a3..389033f 100644 --- a/src/BuildingBlocks/OpenTelemetryCollector/Extensions.cs +++ b/src/BuildingBlocks/OpenTelemetryCollector/Extensions.cs @@ -162,10 +162,7 @@ public static class Extensions { instrumentationOptions.RecordException = true; }) - .AddEntityFrameworkCoreInstrumentation(instrumentationOptions => - { - instrumentationOptions.SetDbStatementForText = true; - }) + .AddEntityFrameworkCoreInstrumentation() .AddSource(DiagnosticHeaders.DefaultListenerName) .AddNpgsql() // `AddSource` for adding custom activity sources diff --git a/src/BuildingBlocks/TestBase/TestBase.cs b/src/BuildingBlocks/TestBase/TestBase.cs index 360a3af..5797b30 100644 --- a/src/BuildingBlocks/TestBase/TestBase.cs +++ b/src/BuildingBlocks/TestBase/TestBase.cs @@ -24,6 +24,7 @@ using Microsoft.Extensions.Logging; using MongoDB.Driver; using NSubstitute; using Respawn; +using Respawn.Graph; using WebMotions.Fake.Authentication.JwtBearer; using Xunit; using Xunit.Abstractions; @@ -579,16 +580,18 @@ where TEntryPoint : class private Respawner _reSpawnerPersistDb; private NpgsqlConnection DefaultDbConnection { get; set; } private NpgsqlConnection PersistDbConnection { get; set; } - + private Type _dbContextType; public TestFixtureCore( TestFixture integrationTestFixture, - ITestOutputHelper outputHelper + ITestOutputHelper outputHelper, + Type dbContextType = null ) { Fixture = integrationTestFixture; integrationTestFixture.RegisterServices(RegisterTestsServices); integrationTestFixture.Logger = integrationTestFixture.CreateLogger(outputHelper); + _dbContextType = dbContextType; } public TestFixture Fixture { get; } @@ -613,25 +616,40 @@ where TEntryPoint : class if (!string.IsNullOrEmpty(persistOptions?.ConnectionString)) { - await Fixture.PersistMessageBackgroundService.StartAsync( - Fixture.CancellationTokenSource.Token); - PersistDbConnection = new NpgsqlConnection(persistOptions.ConnectionString); await PersistDbConnection.OpenAsync(); + + using var scope = Fixture.ServiceProvider.CreateScope(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + await dbContext.Database.EnsureCreatedAsync(); + + await Fixture.PersistMessageBackgroundService.StartAsync( + Fixture.CancellationTokenSource.Token); _reSpawnerPersistDb = await Respawner.CreateAsync( PersistDbConnection, new RespawnerOptions { DbAdapter = DbAdapter.Postgres }); } - if (!string.IsNullOrEmpty(postgresOptions?.ConnectionString)) + if (!string.IsNullOrEmpty(postgresOptions?.ConnectionString) && _dbContextType != null) { DefaultDbConnection = new NpgsqlConnection(postgresOptions.ConnectionString); await DefaultDbConnection.OpenAsync(); + using var scope = Fixture.ServiceProvider.CreateScope(); + + if (scope.ServiceProvider.GetRequiredService(_dbContextType) is DbContext dbContext) + { + await dbContext.Database.EnsureCreatedAsync(); + } + _reSpawnerDefaultDb = await Respawner.CreateAsync( DefaultDbConnection, - new RespawnerOptions { DbAdapter = DbAdapter.Postgres }); + new RespawnerOptions + { + DbAdapter = DbAdapter.Postgres, + TablesToIgnore = ["__EFMigrationsHistory",] + }); await SeedDataAsync(); } @@ -735,7 +753,7 @@ where TWContext : DbContext protected TestWriteBase( TestWriteFixture integrationTestFixture, ITestOutputHelper outputHelper = null - ) : base(integrationTestFixture, outputHelper) + ) : base(integrationTestFixture, outputHelper, typeof(TWContext)) { Fixture = integrationTestFixture; } @@ -753,7 +771,7 @@ where TRContext : MongoDbContext TestFixture integrationTestFixture, ITestOutputHelper outputHelper = null ) : - base(integrationTestFixture, outputHelper) + base(integrationTestFixture, outputHelper, typeof(TWContext)) { Fixture = integrationTestFixture; } diff --git a/src/Services/Booking/src/Booking/Booking.csproj b/src/Services/Booking/src/Booking/Booking.csproj index 496a346..1f51e1c 100644 --- a/src/Services/Booking/src/Booking/Booking.csproj +++ b/src/Services/Booking/src/Booking/Booking.csproj @@ -1,7 +1,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Booking/src/Booking/Extensions/Infrastructure/InfrastructureExtensions.cs b/src/Services/Booking/src/Booking/Extensions/Infrastructure/InfrastructureExtensions.cs index 7c11a02..f86f6a1 100644 --- a/src/Services/Booking/src/Booking/Extensions/Infrastructure/InfrastructureExtensions.cs +++ b/src/Services/Booking/src/Booking/Extensions/Infrastructure/InfrastructureExtensions.cs @@ -12,6 +12,7 @@ using BuildingBlocks.PersistMessageProcessor; using BuildingBlocks.ProblemDetails; using BuildingBlocks.Web; using Figgle; +using Figgle.Fonts; using FluentValidation; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; diff --git a/src/Services/Booking/tests/IntegrationTest/Booking/Features/CreateBookingTests.cs b/src/Services/Booking/tests/IntegrationTest/Booking/Features/CreateBookingTests.cs index c51b072..608e419 100644 --- a/src/Services/Booking/tests/IntegrationTest/Booking/Features/CreateBookingTests.cs +++ b/src/Services/Booking/tests/IntegrationTest/Booking/Features/CreateBookingTests.cs @@ -40,7 +40,7 @@ namespace Integration.Test.Booking.Features var response = await Fixture.SendAsync(command); // Assert - response?.Id.Should().BeGreaterOrEqualTo(0); + response?.Id.Should().BeGreaterThanOrEqualTo(0); (await Fixture.WaitForPublishing()).Should().Be(true); } diff --git a/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj index 660ce90..a7cf7e0 100644 --- a/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Services/Flight/src/Flight/Extensions/Infrastructure/InfrastructureExtensions.cs b/src/Services/Flight/src/Flight/Extensions/Infrastructure/InfrastructureExtensions.cs index 0da7b73..f65806b 100644 --- a/src/Services/Flight/src/Flight/Extensions/Infrastructure/InfrastructureExtensions.cs +++ b/src/Services/Flight/src/Flight/Extensions/Infrastructure/InfrastructureExtensions.cs @@ -12,6 +12,7 @@ using BuildingBlocks.PersistMessageProcessor; using BuildingBlocks.ProblemDetails; using BuildingBlocks.Web; using Figgle; +using Figgle.Fonts; using Flight.Data; using Flight.Data.Seed; using Flight.GrpcServer.Services; diff --git a/src/Services/Flight/src/Flight/Flight.csproj b/src/Services/Flight/src/Flight/Flight.csproj index adf24bf..da1c112 100644 --- a/src/Services/Flight/src/Flight/Flight.csproj +++ b/src/Services/Flight/src/Flight/Flight.csproj @@ -1,13 +1,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj b/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj index 571041a..cc7a967 100644 --- a/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj +++ b/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Services/Flight/tests/IntegrationTest/Flight/Features/GetAvailableFlightsTests.cs b/src/Services/Flight/tests/IntegrationTest/Flight/Features/GetAvailableFlightsTests.cs index 2c15fee..36f9be4 100644 --- a/src/Services/Flight/tests/IntegrationTest/Flight/Features/GetAvailableFlightsTests.cs +++ b/src/Services/Flight/tests/IntegrationTest/Flight/Features/GetAvailableFlightsTests.cs @@ -34,6 +34,6 @@ public class GetAvailableFlightsTests : FlightIntegrationTestBase // Assert response?.Should().NotBeNull(); - response?.Count.Should().BeGreaterOrEqualTo(2); + response?.Count.Should().BeGreaterThanOrEqualTo(2); } } \ No newline at end of file diff --git a/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj index 571041a..cc7a967 100644 --- a/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Services/Flight/tests/IntegrationTest/Seat/Features/GetAvailableSeatsTests.cs b/src/Services/Flight/tests/IntegrationTest/Seat/Features/GetAvailableSeatsTests.cs index 2ebe143..4fc6a52 100644 --- a/src/Services/Flight/tests/IntegrationTest/Seat/Features/GetAvailableSeatsTests.cs +++ b/src/Services/Flight/tests/IntegrationTest/Seat/Features/GetAvailableSeatsTests.cs @@ -38,6 +38,6 @@ public class GetAvailableSeatsTests : FlightIntegrationTestBase // Assert response?.Should().NotBeNull(); - response?.SeatDtos?.Count.Should().BeGreaterOrEqualTo(1); + response?.SeatDtos?.Count.Should().BeGreaterThanOrEqualTo(1); } } \ No newline at end of file diff --git a/src/Services/Flight/tests/UnitTest/Unit.Test.csproj b/src/Services/Flight/tests/UnitTest/Unit.Test.csproj index 571041a..cc7a967 100644 --- a/src/Services/Flight/tests/UnitTest/Unit.Test.csproj +++ b/src/Services/Flight/tests/UnitTest/Unit.Test.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs b/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs index 0728e32..0feec25 100644 --- a/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs +++ b/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs @@ -7,6 +7,7 @@ using BuildingBlocks.PersistMessageProcessor; using BuildingBlocks.ProblemDetails; using BuildingBlocks.Web; using Figgle; +using Figgle.Fonts; using FluentValidation; using Identity.Data; using Identity.Data.Seed; diff --git a/src/Services/Identity/src/Identity/Identity.csproj b/src/Services/Identity/src/Identity/Identity.csproj index 9f43a71..8431a9f 100644 --- a/src/Services/Identity/src/Identity/Identity.csproj +++ b/src/Services/Identity/src/Identity/Identity.csproj @@ -1,7 +1,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj index e323058..4593e97 100644 --- a/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/InfrastructureExtensions.cs b/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/InfrastructureExtensions.cs index a74cbf8..50d295c 100644 --- a/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/InfrastructureExtensions.cs +++ b/src/Services/Passenger/src/Passenger/Extensions/Infrastructure/InfrastructureExtensions.cs @@ -12,6 +12,7 @@ using BuildingBlocks.PersistMessageProcessor; using BuildingBlocks.ProblemDetails; using BuildingBlocks.Web; using Figgle; +using Figgle.Fonts; using FluentValidation; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; diff --git a/src/Services/Passenger/src/Passenger/Passenger.csproj b/src/Services/Passenger/src/Passenger/Passenger.csproj index d73aa16..d14be73 100644 --- a/src/Services/Passenger/src/Passenger/Passenger.csproj +++ b/src/Services/Passenger/src/Passenger/Passenger.csproj @@ -1,8 +1,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj index ac65886..da6bb43 100644 --- a/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj @@ -7,9 +7,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs b/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs index edd9dfd..bdec472 100644 --- a/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs +++ b/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs @@ -1,9 +1,7 @@ -using System.Threading.Tasks; using BuildingBlocks.Contracts.EventBus.Messages; using BuildingBlocks.TestBase; using FluentAssertions; using Integration.Test.Fakes; -using Passenger.Api; using Passenger.Data; using Xunit; From 3b86cf79179532f697c79cff3a0c02a5fc1689d2 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli Date: Fri, 13 Feb 2026 00:39:59 +0330 Subject: [PATCH 2/4] feat: update packages to .net 10 --- .../SecuritySchemeDocumentTransformer.cs | 36 +++++++++---------- src/BuildingBlocks/TestBase/TestBase.cs | 8 ++--- .../Fakes/FakeReserveSeatResponse.cs | 1 + .../src/Flight/Flights/Dtos/FlightDto.cs | 1 + .../Flight/Flights/ValueObjects/ArriveDate.cs | 1 + .../Flights/ValueObjects/DepartureDate.cs | 1 + .../Flight/Flights/ValueObjects/FlightDate.cs | 1 + .../Seat/Features/ReserveSeatTests.cs | 1 + .../Exceptions/InvalidPassengerIdException.cs | 1 + .../Passenger/Passengers/Dtos/PassengerDto.cs | 1 + .../Exceptions/InvalidAgeException.cs | 1 + .../Exceptions/InvalidNameException.cs | 1 + .../InvalidPassportNumberException.cs | 1 + .../Passengers/Models/PassengerReadModel.cs | 1 + .../CompleteRegisterPassengerTests.cs | 1 + 15 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs b/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs index 6f5ffc7..38b4bb2 100644 --- a/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs +++ b/src/BuildingBlocks/OpenApi/SecuritySchemeDocumentTransformer.cs @@ -15,26 +15,26 @@ public class SecuritySchemeDocumentTransformer : IOpenApiDocumentTransformer document.Components.SecuritySchemes ??= new Dictionary(); var securitySchemes = new Dictionary - { - ["Bearer"] = new OpenApiSecurityScheme - { - Name = "Authorization", - Type = SecuritySchemeType.Http, - Scheme = "bearer", - BearerFormat = "JWT", - In = ParameterLocation.Header, - Description = + { + ["Bearer"] = new OpenApiSecurityScheme + { + Name = "Authorization", + Type = SecuritySchemeType.Http, + Scheme = "bearer", + BearerFormat = "JWT", + In = ParameterLocation.Header, + Description = "Enter 'Bearer' [space] and your token in the text input below.\n\nExample: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'", - }, - ["ApiKey"] = new OpenApiSecurityScheme - { - Name = "X-API-KEY", - Type = SecuritySchemeType.ApiKey, - In = ParameterLocation.Header, - Description = + }, + ["ApiKey"] = new OpenApiSecurityScheme + { + Name = "X-API-KEY", + Type = SecuritySchemeType.ApiKey, + In = ParameterLocation.Header, + Description = "Enter your API key in the text input below.\n\nExample: '12345-abcdef'", - }, - }; + }, + }; foreach (var (key, scheme) in securitySchemes) { diff --git a/src/BuildingBlocks/TestBase/TestBase.cs b/src/BuildingBlocks/TestBase/TestBase.cs index 5797b30..8a31729 100644 --- a/src/BuildingBlocks/TestBase/TestBase.cs +++ b/src/BuildingBlocks/TestBase/TestBase.cs @@ -618,11 +618,11 @@ where TEntryPoint : class { PersistDbConnection = new NpgsqlConnection(persistOptions.ConnectionString); await PersistDbConnection.OpenAsync(); - + using var scope = Fixture.ServiceProvider.CreateScope(); var dbContext = scope.ServiceProvider.GetRequiredService(); await dbContext.Database.EnsureCreatedAsync(); - + await Fixture.PersistMessageBackgroundService.StartAsync( Fixture.CancellationTokenSource.Token); @@ -645,8 +645,8 @@ where TEntryPoint : class _reSpawnerDefaultDb = await Respawner.CreateAsync( DefaultDbConnection, - new RespawnerOptions - { + new RespawnerOptions + { DbAdapter = DbAdapter.Postgres, TablesToIgnore = ["__EFMigrationsHistory",] }); diff --git a/src/Services/Booking/tests/IntegrationTest/Fakes/FakeReserveSeatResponse.cs b/src/Services/Booking/tests/IntegrationTest/Fakes/FakeReserveSeatResponse.cs index 0f37d4a..3c041fa 100644 --- a/src/Services/Booking/tests/IntegrationTest/Fakes/FakeReserveSeatResponse.cs +++ b/src/Services/Booking/tests/IntegrationTest/Fakes/FakeReserveSeatResponse.cs @@ -1,4 +1,5 @@ namespace Integration.Test.Fakes; + using Flight; using MassTransit; diff --git a/src/Services/Flight/src/Flight/Flights/Dtos/FlightDto.cs b/src/Services/Flight/src/Flight/Flights/Dtos/FlightDto.cs index be5c750..83c1379 100644 --- a/src/Services/Flight/src/Flight/Flights/Dtos/FlightDto.cs +++ b/src/Services/Flight/src/Flight/Flights/Dtos/FlightDto.cs @@ -1,6 +1,7 @@ using System; namespace Flight.Flights.Dtos; + public record FlightDto(Guid Id, string FlightNumber, Guid AircraftId, Guid DepartureAirportId, DateTime DepartureDate, DateTime ArriveDate, Guid ArriveAirportId, decimal DurationMinutes, DateTime FlightDate, Enums.FlightStatus Status, decimal Price); \ No newline at end of file diff --git a/src/Services/Flight/src/Flight/Flights/ValueObjects/ArriveDate.cs b/src/Services/Flight/src/Flight/Flights/ValueObjects/ArriveDate.cs index 863579c..0984fd3 100644 --- a/src/Services/Flight/src/Flight/Flights/ValueObjects/ArriveDate.cs +++ b/src/Services/Flight/src/Flight/Flights/ValueObjects/ArriveDate.cs @@ -1,4 +1,5 @@ namespace Flight.Flights.ValueObjects; + using System; using Flight.Flights.Exceptions; diff --git a/src/Services/Flight/src/Flight/Flights/ValueObjects/DepartureDate.cs b/src/Services/Flight/src/Flight/Flights/ValueObjects/DepartureDate.cs index 89eb003..3ebc8de 100644 --- a/src/Services/Flight/src/Flight/Flights/ValueObjects/DepartureDate.cs +++ b/src/Services/Flight/src/Flight/Flights/ValueObjects/DepartureDate.cs @@ -1,4 +1,5 @@ namespace Flight.Flights.ValueObjects; + using System; using Flight.Flights.Exceptions; diff --git a/src/Services/Flight/src/Flight/Flights/ValueObjects/FlightDate.cs b/src/Services/Flight/src/Flight/Flights/ValueObjects/FlightDate.cs index fd56660..5f0b1ce 100644 --- a/src/Services/Flight/src/Flight/Flights/ValueObjects/FlightDate.cs +++ b/src/Services/Flight/src/Flight/Flights/ValueObjects/FlightDate.cs @@ -1,4 +1,5 @@ namespace Flight.Flights.ValueObjects; + using System; using Flight.Flights.Exceptions; diff --git a/src/Services/Flight/tests/IntegrationTest/Seat/Features/ReserveSeatTests.cs b/src/Services/Flight/tests/IntegrationTest/Seat/Features/ReserveSeatTests.cs index 9d658bc..a0d1ad1 100644 --- a/src/Services/Flight/tests/IntegrationTest/Seat/Features/ReserveSeatTests.cs +++ b/src/Services/Flight/tests/IntegrationTest/Seat/Features/ReserveSeatTests.cs @@ -8,6 +8,7 @@ using Integration.Test.Fakes; using Xunit; namespace Integration.Test.Seat.Features; + public class ReserveSeatTests : FlightIntegrationTestBase { public ReserveSeatTests( diff --git a/src/Services/Passenger/src/Passenger/Exceptions/InvalidPassengerIdException.cs b/src/Services/Passenger/src/Passenger/Exceptions/InvalidPassengerIdException.cs index c64319b..ed206d4 100644 --- a/src/Services/Passenger/src/Passenger/Exceptions/InvalidPassengerIdException.cs +++ b/src/Services/Passenger/src/Passenger/Exceptions/InvalidPassengerIdException.cs @@ -1,6 +1,7 @@ using SmartCharging.Infrastructure.Exceptions; namespace Passenger.Exceptions; + using System; public class InvalidPassengerIdException : DomainException diff --git a/src/Services/Passenger/src/Passenger/Passengers/Dtos/PassengerDto.cs b/src/Services/Passenger/src/Passenger/Passengers/Dtos/PassengerDto.cs index 70b750e..6869f43 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Dtos/PassengerDto.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Dtos/PassengerDto.cs @@ -1,2 +1,3 @@ namespace Passenger.Passengers.Dtos; + public record PassengerDto(Guid Id, string Name, string PassportNumber, Enums.PassengerType PassengerType, int Age); \ No newline at end of file diff --git a/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidAgeException.cs b/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidAgeException.cs index 2c0c4bf..0702991 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidAgeException.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidAgeException.cs @@ -1,4 +1,5 @@ namespace Passenger.Passengers.Exceptions; + using BuildingBlocks.Exception; public class InvalidAgeException : BadRequestException diff --git a/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidNameException.cs b/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidNameException.cs index a30aab6..3d1de7a 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidNameException.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidNameException.cs @@ -1,4 +1,5 @@ namespace Passenger.Passengers.Exceptions; + using BuildingBlocks.Exception; diff --git a/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidPassportNumberException.cs b/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidPassportNumberException.cs index be19652..a5ee3ac 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidPassportNumberException.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Exceptions/InvalidPassportNumberException.cs @@ -1,4 +1,5 @@ namespace Passenger.Passengers.Exceptions; + using BuildingBlocks.Exception; diff --git a/src/Services/Passenger/src/Passenger/Passengers/Models/PassengerReadModel.cs b/src/Services/Passenger/src/Passenger/Passengers/Models/PassengerReadModel.cs index 2b13cf1..b02cbf6 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Models/PassengerReadModel.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Models/PassengerReadModel.cs @@ -1,4 +1,5 @@ namespace Passenger.Passengers.Models; + public class PassengerReadModel { public required Guid Id { get; init; } diff --git a/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs b/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs index bdec472..b0a4cbc 100644 --- a/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs +++ b/src/Services/Passenger/tests/IntegrationTest/Passenger/Features/CompleteRegisterPassengerTests.cs @@ -6,6 +6,7 @@ using Passenger.Data; using Xunit; namespace Integration.Test.Passenger.Features; + public class CompleteRegisterPassengerTests : PassengerIntegrationTestBase { From 20bd2ac0bc953a01e85098dd6b40298b014124e0 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli Date: Fri, 13 Feb 2026 00:47:15 +0330 Subject: [PATCH 3/4] docs: update documentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c5fed56..cf01c6a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ -> 🚀 **A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 9.** +> 🚀 **A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 10.** ## You can find other version of this project here: - [Booking with Modular Monolith Architecture](https://github.com/meysamhadeli/booking-modular-monolith) @@ -74,10 +74,10 @@ ## Technologies - Libraries -- ✔️ **[`.NET 9`](https://github.com/dotnet/aspnetcore)** - .NET Framework and .NET Core, including ASP.NET and ASP.NET Core. +- ✔️ **[`.NET 10`](https://github.com/dotnet/aspnetcore)** - .NET Framework and .NET Core, including ASP.NET and ASP.NET Core. - ✔️ **[`MVC Versioning API`](https://github.com/microsoft/aspnet-api-versioning)** - Set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core. - ✔️ **[`EF Core`](https://github.com/dotnet/efcore)** - Modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. -- ✔️ **[`AspNetCore OpenApi`](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/aspnetcore-openapi?view=aspnetcore-9.0&tabs=visual-studio#configure-openapi-document-generation)** - Provides built-in support for OpenAPI document generation in ASP.NET Core. +- ✔️ **[`AspNetCore OpenApi`](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/aspnetcore-openapi)** - Provides built-in support for OpenAPI document generation in ASP.NET Core. - ✔️ **[`Masstransit`](https://github.com/MassTransit/MassTransit)** - Distributed Application Framework for .NET. - ✔️ **[`MediatR`](https://github.com/jbogard/MediatR)** - Simple, unambitious mediator implementation in .NET. - ✔️ **[`FluentValidation`](https://github.com/FluentValidation/FluentValidation)** - Popular .NET validation library for building strongly-typed validation rules. From 38c339c1aa9a20ac44368c2beee5c19a901aa291 Mon Sep 17 00:00:00 2001 From: Meysam Hadeli Date: Fri, 13 Feb 2026 00:49:49 +0330 Subject: [PATCH 4/4] chore: update ci build version --- .github/actions/build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 2e85bd4..cfd5a55 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -34,7 +34,7 @@ runs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.x.x' + dotnet-version: '10.x.x' # https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools - name: Restore .NET Tools