From 33b9856379356efcefebbd04ba1408d8dcb28c73 Mon Sep 17 00:00:00 2001 From: "Jefferson L. da Silva" Date: Sun, 15 Mar 2026 18:57:13 -0300 Subject: [PATCH 1/3] Updates project dependencies and coding style configurations Updates .NET SDK to 10.0.201 and bumps several NuGet packages, including Microsoft.AspNetCore, Npgsql, and Testcontainers. Adds EditorConfig rules to enforce `Async` naming suffixes and ensure namespaces match the folder structure. Refines the database migration history configuration by using named arguments for improved clarity. --- .editorconfig | 13 ++++ Directory.Packages.props | 60 +++++++++---------- .../DependencyInjectionConfig.cs | 5 +- global.json | 2 +- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5f1f4fb..7bd232a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -42,6 +42,9 @@ tab_width = 4 dotnet_separate_import_directive_groups = false dotnet_sort_system_directives_first = false +# Namespace matching folder structure preferences +dotnet_style_namespace_match_folder = true:warning + # this. and Me. preferences dotnet_style_qualification_for_event = false:warning dotnet_style_qualification_for_field = false:warning @@ -202,6 +205,16 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case +dotnet_naming_rule.async_methods_end_in_async.symbols = async_methods +dotnet_naming_rule.async_methods_end_in_async.style = end_in_async +dotnet_naming_rule.async_methods_end_in_async.severity = warning + +dotnet_naming_symbols.async_methods.applicable_kinds = method +dotnet_naming_symbols.async_methods.required_modifiers = async + +dotnet_naming_style.end_in_async.required_sufix = Async +dotnet_naming_style.end_in_async.capitalization = pascal_case + # Symbol specifications dotnet_naming_symbols.interface.applicable_kinds = interface diff --git a/Directory.Packages.props b/Directory.Packages.props index 758bf42..e708603 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,30 +5,30 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + @@ -40,26 +40,26 @@ - - - - + + + + - + - + - + - - - + + + diff --git a/InvoiceReminder.CrossCutting.IoC/DependencyInjectionConfig.cs b/InvoiceReminder.CrossCutting.IoC/DependencyInjectionConfig.cs index 56276ee..c3fbfab 100644 --- a/InvoiceReminder.CrossCutting.IoC/DependencyInjectionConfig.cs +++ b/InvoiceReminder.CrossCutting.IoC/DependencyInjectionConfig.cs @@ -67,7 +67,10 @@ private static IServiceCollection AddDbContext(this IServiceCollection services) var config = sp.GetRequiredService(); _ = options.UseNpgsql(config.GetConnectionString("DatabaseConnection"), - b => b.MigrationsHistoryTable("__EFMigrationsHistory", "invoice_reminder") + b => b.MigrationsHistoryTable( + tableName: "__EFMigrationsHistory", + schema: "invoice_reminder" + ) ); }); diff --git a/global.json b/global.json index 2cf953f..c5c2593 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.102" + "version": "10.0.201" }, "test": { "runner": "Microsoft.Testing.Platform" From 20d1f62871c06e8f1e8cde73dca803a604249e55 Mon Sep 17 00:00:00 2001 From: "Jefferson L. da Silva" Date: Sun, 15 Mar 2026 19:43:19 -0300 Subject: [PATCH 2/3] Enforces Async naming convention for asynchronous methods Fixes a typo in the EditorConfig naming rule and renames asynchronous methods across the API, services, and repository layers to consistently include the Async suffix. --- .editorconfig | 2 +- .../Endpoints/SendMessageEndpoints.cs | 2 +- InvoiceReminder.Data/Repository/UnitOfWork.cs | 8 +++--- .../SendMessage/ISendMessageService.cs | 2 +- .../SendMessage/SendMessageService.cs | 4 +-- .../JobSettings/CronJob.cs | 2 +- .../Endpoints/SendMessageEndpointsTests.cs | 28 +++++++++---------- .../SendMessage/SendMessageServiceTests.cs | 22 +++++++-------- .../JobSettings/CronJobTests.cs | 6 ++-- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.editorconfig b/.editorconfig index 7bd232a..31931b5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -212,7 +212,7 @@ dotnet_naming_rule.async_methods_end_in_async.severity = warning dotnet_naming_symbols.async_methods.applicable_kinds = method dotnet_naming_symbols.async_methods.required_modifiers = async -dotnet_naming_style.end_in_async.required_sufix = Async +dotnet_naming_style.end_in_async.required_suffix = Async dotnet_naming_style.end_in_async.capitalization = pascal_case # Symbol specifications diff --git a/InvoiceReminder.API/Endpoints/SendMessageEndpoints.cs b/InvoiceReminder.API/Endpoints/SendMessageEndpoints.cs index 2f84fdd..9a64c7b 100644 --- a/InvoiceReminder.API/Endpoints/SendMessageEndpoints.cs +++ b/InvoiceReminder.API/Endpoints/SendMessageEndpoints.cs @@ -17,7 +17,7 @@ private static void MapSendMessage(RouteGroupBuilder endpoint) { _ = endpoint.MapGet("/{id}", async (ISendMessageService messageService, Guid id, CancellationToken ct) => { - var result = await messageService.SendMessage(id, ct); + var result = await messageService.SendMessageAsync(id, ct); return !string.IsNullOrEmpty(result) ? Results.Ok(result) diff --git a/InvoiceReminder.Data/Repository/UnitOfWork.cs b/InvoiceReminder.Data/Repository/UnitOfWork.cs index 56f1c50..b11f9ca 100644 --- a/InvoiceReminder.Data/Repository/UnitOfWork.cs +++ b/InvoiceReminder.Data/Repository/UnitOfWork.cs @@ -30,7 +30,7 @@ public async Task SaveChangesAsync(CancellationToken cancellationToken = default try { - await OpenConnection(cancellationToken); + await OpenConnectionAsync(cancellationToken); transaction = await _context.Database.BeginTransactionAsync(cancellationToken); @@ -67,11 +67,11 @@ public async Task SaveChangesAsync(CancellationToken cancellationToken = default finally { transaction?.Dispose(); - await CloseConnection(); + await CloseConnectionAsync(); } } - private async Task OpenConnection(CancellationToken cancellationToken = default) + private async Task OpenConnectionAsync(CancellationToken cancellationToken = default) { if (_connection.State == ConnectionState.Closed) { @@ -79,7 +79,7 @@ private async Task OpenConnection(CancellationToken cancellationToken = default) } } - private async Task CloseConnection() + private async Task CloseConnectionAsync() { if (_connection.State == ConnectionState.Open) { diff --git a/InvoiceReminder.ExternalServices/SendMessage/ISendMessageService.cs b/InvoiceReminder.ExternalServices/SendMessage/ISendMessageService.cs index e9de2cc..9876f18 100644 --- a/InvoiceReminder.ExternalServices/SendMessage/ISendMessageService.cs +++ b/InvoiceReminder.ExternalServices/SendMessage/ISendMessageService.cs @@ -2,5 +2,5 @@ namespace InvoiceReminder.ExternalServices.SendMessage; public interface ISendMessageService { - Task SendMessage(Guid userId, CancellationToken cancellationToken = default); + Task SendMessageAsync(Guid userId, CancellationToken cancellationToken = default); } diff --git a/InvoiceReminder.ExternalServices/SendMessage/SendMessageService.cs b/InvoiceReminder.ExternalServices/SendMessage/SendMessageService.cs index 9bd8a8a..67a0193 100644 --- a/InvoiceReminder.ExternalServices/SendMessage/SendMessageService.cs +++ b/InvoiceReminder.ExternalServices/SendMessage/SendMessageService.cs @@ -33,7 +33,7 @@ public SendMessageService( _logger = logger; } - public async Task SendMessage(Guid userId, CancellationToken cancellationToken = default) + public async Task SendMessageAsync(Guid userId, CancellationToken cancellationToken = default) { IDictionary attachments; @@ -77,7 +77,7 @@ public async Task SendMessage(Guid userId, CancellationToken cancellatio } catch (OperationCanceledException ex) when (cancellationToken.IsCancellationRequested) { - var method = $"{nameof(SendMessageService)}.{nameof(SendMessage)}"; + var method = $"{nameof(SendMessageService)}.{nameof(SendMessageAsync)}"; var contextualInfo = $"Method {method} execution was interrupted by a CancellationToken Request..."; if (_logger.IsEnabled(LogLevel.Warning)) diff --git a/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs b/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs index 0291503..7cded0e 100644 --- a/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs +++ b/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs @@ -31,6 +31,6 @@ public async Task Execute(IJobExecutionContext context) } // possível uso de um agendamento de envio de mensagem para lembrete no dia do vencimento?... - _ = await service.SendMessage(id); + _ = await service.SendMessageAsync(id); } } diff --git a/InvoiceReminder.UnitTests.API/Endpoints/SendMessageEndpointsTests.cs b/InvoiceReminder.UnitTests.API/Endpoints/SendMessageEndpointsTests.cs index 62fee02..131da7a 100644 --- a/InvoiceReminder.UnitTests.API/Endpoints/SendMessageEndpointsTests.cs +++ b/InvoiceReminder.UnitTests.API/Endpoints/SendMessageEndpointsTests.cs @@ -44,7 +44,7 @@ public async Task SendMessage_WhenUserIsAuthenticated_ShouldReturnOk() var expectedResult = "Total messages sent: 1"; - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns(Task.FromResult(expectedResult)); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -56,7 +56,7 @@ public async Task SendMessage_WhenUserIsAuthenticated_ShouldReturnOk() var result = await response.Content.ReadAsStringAsync(TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); response.StatusCode.ShouldBe(HttpStatusCode.OK); @@ -94,7 +94,7 @@ public async Task SendMessage_WhenUserIsAuthenticatedButServiceReturnsEmptyResul var request = new HttpRequestMessage(HttpMethod.Get, $"{basepath}/{userId}"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "test_token"); - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns(Task.FromResult(string.Empty)); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -106,7 +106,7 @@ public async Task SendMessage_WhenUserIsAuthenticatedButServiceReturnsEmptyResul var result = await response.Content.ReadFromJsonAsync(TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); response.StatusCode.ShouldBe(HttpStatusCode.InternalServerError); @@ -127,7 +127,7 @@ public async Task SendMessage_WhenUserIsAuthenticatedButServiceReturnsNull_Shoul var request = new HttpRequestMessage(HttpMethod.Get, $"{basepath}/{userId}"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "test_token"); - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns(Task.FromResult(null)); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -139,7 +139,7 @@ public async Task SendMessage_WhenUserIsAuthenticatedButServiceReturnsNull_Shoul var result = await response.Content.ReadFromJsonAsync(TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); response.StatusCode.ShouldBe(HttpStatusCode.InternalServerError); @@ -158,7 +158,7 @@ public async Task SendMessage_WhenUserIsAuthenticatedButServiceThrowsException_S var request = new HttpRequestMessage(HttpMethod.Get, $"{basepath}/{userId}"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "test_token"); - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -170,7 +170,7 @@ public async Task SendMessage_WhenUserIsAuthenticatedButServiceThrowsException_S var result = await response.Content.ReadFromJsonAsync(TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); response.StatusCode.ShouldBe(HttpStatusCode.InternalServerError); @@ -191,7 +191,7 @@ public async Task SendMessage_WithValidUserId_CallsServiceWithCorrectParameters( var expectedResult = "Total messages sent: 3"; - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns(Task.FromResult(expectedResult)); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -202,7 +202,7 @@ public async Task SendMessage_WithValidUserId_CallsServiceWithCorrectParameters( var response = await _client.SendAsync(request, TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage( + _ = _sendMessageService.Received(1).SendMessageAsync( Arg.Is(id => id == userId), Arg.Any() ); @@ -220,7 +220,7 @@ public async Task SendMessage_WhenServiceReturnsNoMessages_ShouldStillReturnOkWi var expectedResult = "Total messages sent: 0"; - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns(Task.FromResult(expectedResult)); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -232,7 +232,7 @@ public async Task SendMessage_WhenServiceReturnsNoMessages_ShouldStillReturnOkWi var result = await response.Content.ReadAsStringAsync(TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); response.StatusCode.ShouldBe(HttpStatusCode.OK); @@ -253,7 +253,7 @@ public async Task SendMessage_WhenServiceReturnsWarningMessage_ShouldReturnOkWit var expectedResult = $"No Authentication Token found for userId: {userId}"; - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns(Task.FromResult(expectedResult)); _ = _authorizationService.AuthorizeAsync(Arg.Any(), Arg.Any(), @@ -265,7 +265,7 @@ public async Task SendMessage_WhenServiceReturnsWarningMessage_ShouldReturnOkWit var result = await response.Content.ReadAsStringAsync(TestContext.CancellationToken); // Assert - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); response.StatusCode.ShouldBe(HttpStatusCode.OK); diff --git a/InvoiceReminder.UnitTests.ExternalServices/SendMessage/SendMessageServiceTests.cs b/InvoiceReminder.UnitTests.ExternalServices/SendMessage/SendMessageServiceTests.cs index 2b35eda..1fdc67d 100644 --- a/InvoiceReminder.UnitTests.ExternalServices/SendMessage/SendMessageServiceTests.cs +++ b/InvoiceReminder.UnitTests.ExternalServices/SendMessage/SendMessageServiceTests.cs @@ -129,7 +129,7 @@ public async Task SendMessage_Should_Send_Messages_Successfully() .Returns(invoice); // Act - var result = await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken); + var result = await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken); // Assert _ = _userRepository.Received(1).GetByIdAsync(Arg.Any(), Arg.Any()); @@ -182,7 +182,7 @@ public async Task SendMessage_With_MultipleAttachments_Should_Send_All_Messages( .Returns(invoice2); // Act - var result = await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken); + var result = await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken); // Assert _ = _barcodeReader.Received(2).ReadTextContentFromPdf(Arg.Any(), Arg.Any(), Arg.Any()); @@ -211,7 +211,7 @@ public async Task SendMessage_With_EmptyAttachments_Should_Return_Zero_Messages( .Returns(Task.FromResult>(attachments)); // Act - var result = await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken); + var result = await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken); // Assert _ = _barcodeReader.DidNotReceive().ReadTextContentFromPdf(Arg.Any(), Arg.Any(), Arg.Any()); @@ -245,7 +245,7 @@ public async Task SendMessage_Should_Set_Invoice_Properties_Correctly() .Returns(generatedInvoice); // Act - _ = await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken); + _ = await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken); // Assert _ = _invoiceRepository.Received(1).BulkInsertAsync( @@ -273,7 +273,7 @@ public async Task SendMessage_ShouldNot_SendMessages_When_UserIsNull() _ = _logger.IsEnabled(Arg.Any()).Returns(true); // Act - var result = await _sendMessageService.SendMessage(userId, TestContext.CancellationToken); + var result = await _sendMessageService.SendMessageAsync(userId, TestContext.CancellationToken); // Assert result.ShouldBe("User not found!"); @@ -307,7 +307,7 @@ public async Task SendMessage_ShouldNot_SendMessages_When_UserHasNoAuthenticatio _ = _logger.IsEnabled(Arg.Any()).Returns(true); // Act - var result = await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken); + var result = await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken); // Assert result.ShouldBe($"No Authentication Token found for userId: {user.Id}"); @@ -339,7 +339,7 @@ public async Task SendMessage_Should_Log_Error_On_Exception() // Act && Assert _ = await Should.ThrowAsync(async () => - await _sendMessageService.SendMessage(userId, TestContext.CancellationToken) + await _sendMessageService.SendMessageAsync(userId, TestContext.CancellationToken) ); _logger.Received(1).Log( @@ -371,7 +371,7 @@ public async Task SendMessage_GmailService_ThrowsException_Should_Log_And_Rethro // Act && Assert _ = await Should.ThrowAsync(async () => - await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken) + await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken) ); _logger.Received(1).Log( @@ -410,7 +410,7 @@ public async Task SendMessage_BarcodeReader_ThrowsException_Should_Log_And_Rethr // Act && Assert _ = await Should.ThrowAsync(async () => - await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken) + await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken) ); _logger.Received(1).Log( @@ -438,7 +438,7 @@ public async Task SendMessage_OperationCanceledException_Should_Log_Warning_And_ // Act && Assert _ = await Should.ThrowAsync(async () => - await _sendMessageService.SendMessage(userId, cts.Token) + await _sendMessageService.SendMessageAsync(userId, cts.Token) ); _logger.Received(1).Log( @@ -481,7 +481,7 @@ public async Task SendMessage_TelegramService_ThrowsException_Should_Log_And_Ret // Act && Assert _ = await Should.ThrowAsync(async () => - await _sendMessageService.SendMessage(user.Id, TestContext.CancellationToken) + await _sendMessageService.SendMessageAsync(user.Id, TestContext.CancellationToken) ); _ = _invoiceRepository.DidNotReceive() diff --git a/InvoiceReminder.UnitTests.JobScheduler/JobSettings/CronJobTests.cs b/InvoiceReminder.UnitTests.JobScheduler/JobSettings/CronJobTests.cs index 1095705..b23fedf 100644 --- a/InvoiceReminder.UnitTests.JobScheduler/JobSettings/CronJobTests.cs +++ b/InvoiceReminder.UnitTests.JobScheduler/JobSettings/CronJobTests.cs @@ -57,7 +57,7 @@ public async Task Execute_ShouldCreateScopeResolveServiceAndSendMessage() // Assert _ = _serviceScopeFactory.Received(1).CreateScope(); - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); _logger.Received(1).Log( LogLevel.Information, @@ -95,7 +95,7 @@ public async Task Execute_SendMessageFails_ShouldNotThrowExceptionAndStillLog() // Arrange var cronJob = new CronJob(_logger, _serviceScopeFactory); - _ = _sendMessageService.SendMessage(Arg.Any(), Arg.Any()) + _ = _sendMessageService.SendMessageAsync(Arg.Any(), Arg.Any()) .Returns("Total messages sent: 0"); _ = _logger.IsEnabled(Arg.Any()).Returns(true); @@ -105,7 +105,7 @@ public async Task Execute_SendMessageFails_ShouldNotThrowExceptionAndStillLog() // Assert _ = _serviceScopeFactory.Received(1).CreateScope(); - _ = _sendMessageService.Received(1).SendMessage(Arg.Any(), Arg.Any()); + _ = _sendMessageService.Received(1).SendMessageAsync(Arg.Any(), Arg.Any()); _logger.Received(1).Log( LogLevel.Information, From c6103573c6ee620cbca8e786cd85311270cb1799 Mon Sep 17 00:00:00 2001 From: "Jefferson L. da Silva" Date: Sun, 15 Mar 2026 20:04:53 -0300 Subject: [PATCH 3/3] Passes CancellationToken to message service in CronJob Ensures the `SendMessageAsync` call in the background job respects the cancellation token from the job context for improved lifecycle management and graceful shutdowns. Removes an obsolete developer comment. --- InvoiceReminder.JobScheduler/JobSettings/CronJob.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs b/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs index 7cded0e..afddc52 100644 --- a/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs +++ b/InvoiceReminder.JobScheduler/JobSettings/CronJob.cs @@ -30,7 +30,6 @@ public async Task Execute(IJobExecutionContext context) _logger.LogInformation("{Message}", message); } - // possível uso de um agendamento de envio de mensagem para lembrete no dia do vencimento?... - _ = await service.SendMessageAsync(id); + _ = await service.SendMessageAsync(id, context.CancellationToken); } }