Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
eb43dae
Update code style, API usage, and middleware config
MartinHock Jun 8, 2026
4d2b4a6
Override DisposeAsync and improve resource cleanup
MartinHock Jun 8, 2026
aa1127e
Use InvariantCulture for route and log formatting
MartinHock Jun 8, 2026
5c56061
issue-736:: removed ca1307 warningss
MartinHock Jun 8, 2026
54baf64
issue-736: disabled S125 because at tsat place S125 is wrong
MartinHock Jun 8, 2026
19ce16d
issue-736: removed ca1707 warning & CA1727 hanged xml doc accordingly
MartinHock Jun 8, 2026
f20a2b1
Refactor Constants class and update naming conventions
MartinHock Jun 8, 2026
9abd638
Update log parameter names to PascalCase for consistency
MartinHock Jun 8, 2026
4ec38fc
Update constant naming to PascalCase and cleanup usings
MartinHock Jun 8, 2026
3433d38
Update domain event filter to use Count instead of Any
MartinHock Jun 8, 2026
4681f78
Update logging, DbContext access, and disposal patterns
MartinHock Jun 8, 2026
f872ca8
issues-736: renamed parameters fror IMailSender to no longer probok a…
MartinHock Jun 8, 2026
8439a2a
Disable CLS compliance rule CA1014 in .editorconfig
MartinHock Jun 8, 2026
1d84677
Update editorconfig, gitignore, slnx, and add runsettings
MartinHock Jun 8, 2026
e7e6eb8
issue-736: removed ca1307 waqrnings
MartinHock Jun 8, 2026
a7d8341
Adopt LoggerMessage.Define and update code style rules
MartinHock Jun 8, 2026
03ddfa4
Remove default null assignment from PhoneNumber property
MartinHock Jun 8, 2026
a35b340
Clarify service docs and return Result on delete
MartinHock Jun 8, 2026
8107c57
isues-1746: Refactor GetContributorQuery namespace and usages
MartinHock Jun 8, 2026
395f13a
Refactor token naming and make CreateStream static
MartinHock Jun 8, 2026
204fa99
Disable CA1848/CA1873 analyzers, add .editorconfig to src
MartinHock Jun 8, 2026
037a81d
issue-736:
MartinHock Jun 8, 2026
9857a3f
fix: align Aspire tests target framework with Aspire host
Copilot Jun 8, 2026
446aebd
Merge branch 'main' into issue/736-add-more-warnings-as-errors
ardalis Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,19 @@ csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent

dotnet_diagnostic.CA1707.severity = none

dotnet_diagnostic.CA1014.severity = none
// CA1848: Use 'LoggerMessage.Define' instead of 'LoggerMessage.Define<T>'
// DO not force Logger Massages Delegates all everywhere
dotnet_diagnostic.CA1848.severity= none
# Avoid forcing LoggerMessage-style logging everywhere in this template/sample repository.
dotnet_diagnostic.CA1873.severity = none

###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ bld/
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Local SonarQube Scanner working directory
.sonarqube/

# Visual Studio local workspace state
.vs/
# Hugo generated site output
docs/public/

Expand Down
3 changes: 3 additions & 0 deletions Clean.Architecture.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
</Configurations>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitignore" />
<File Path=".template.config/template.json" />
<File Path="CleanArchitecture.nuspec" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
</Folder>
<Folder Name="/src/">
<File Path=".editorconfig" />
<Project Path="src/Clean.Architecture.Core/Clean.Architecture.Core.csproj" />
<Project Path="src/Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj" />
<Project Path="src/Clean.Architecture.UseCases/Clean.Architecture.UseCases.csproj" />
Expand All @@ -22,6 +24,7 @@
<Project Path="src/Clean.Architecture.ServiceDefaults/Clean.Architecture.ServiceDefaults.csproj" />
</Folder>
<Folder Name="/tests/">
<File Path="tests/.editorconfig" />
<Project Path="tests/Clean.Architecture.FunctionalTests/Clean.Architecture.FunctionalTests.csproj">
<BuildDependency Project="src/Clean.Architecture.Web/Clean.Architecture.Web.csproj" />
</Project>
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ContributorDeletedHandler(ILogger<ContributorDeletedHandler> logger
{
public async ValueTask Handle(ContributorDeletedEvent domainEvent, CancellationToken cancellationToken)
{
logger.LogInformation("Handling Contributed Deleted event for {contributorId}", domainEvent.ContributorId);
logger.LogInformation("Handling Contributed Deleted event for {ContributorId}", domainEvent.ContributorId);

await emailSender.SendEmailAsync("to@test.com",
"from@test.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ContributorNameUpdatedEmailNotificationHandler(
{
public async ValueTask Handle(ContributorNameUpdatedEvent domainEvent, CancellationToken cancellationToken)
{
logger.LogInformation("Handling Contributor Name Updated event for {contributorId}", domainEvent.Contributor.Id);
logger.LogInformation("Handling Contributor Name Updated event for {ContributorId}", domainEvent.Contributor.Id);

await emailSender.SendEmailAsync("to@test.com",
"from@test.com",
Expand Down
2 changes: 1 addition & 1 deletion src/Clean.Architecture.Core/Interfaces/IEmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface IEmailSender
{
Task SendEmailAsync(string to, string from, string subject, string body);
Task SendEmailAsync(string recipientEmail, string senderEmail, string subject, string body);
}
34 changes: 26 additions & 8 deletions src/Clean.Architecture.Core/Services/DeleteContributorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,41 @@
namespace Clean.Architecture.Core.Services;

/// <summary>
/// This is here mainly so there's an example of a domain service
/// This service is here mainly so there's an example of a domain service
/// and also to demonstrate how to fire domain events from a service.
/// </summary>
/// <param name="_repository"></param>
/// <param name="_mediator"></param>
/// <param name="_logger"></param>
public class DeleteContributorService(IRepository<Contributor> _repository,
IMediator _mediator,
ILogger<DeleteContributorService> _logger) : IDeleteContributorService
/// <remarks>
/// The logging call intentionally uses a precompiled <see cref="LoggerMessage" /> delegate.
/// This avoids analyzer warning CA1848 and demonstrates the recommended high-performance
/// logging pattern without using <c>LoggerExtensions.LogInformation</c> directly.
/// </remarks>
/// <param name="repository">The repository used to load and delete contributors.</param>
/// <param name="mediator">The mediator used to publish domain events.</param>
/// <param name="logger">The logger used by the service.</param>
public class DeleteContributorService(
IRepository<Contributor> repository,
IMediator mediator,
ILogger<DeleteContributorService> logger) : IDeleteContributorService
{
private static readonly Action<ILogger, ContributorId, Exception?> LogDeletingContributor =
LoggerMessage.Define<ContributorId>(
LogLevel.Information,
new EventId(1, nameof(DeleteContributor)),
"Deleting Contributor {ContributorId}");

private readonly IRepository<Contributor> _repository = repository;
private readonly IMediator _mediator = mediator;
private readonly ILogger<DeleteContributorService> _logger = logger;

public async ValueTask<Result> DeleteContributor(ContributorId contributorId)
{
_logger.LogInformation("Deleting Contributor {contributorId}", contributorId);
LogDeletingContributor(_logger, contributorId, null);

Contributor? aggregateToDelete = await _repository.GetByIdAsync(contributorId);
if (aggregateToDelete == null) return Result.NotFound();

await _repository.DeleteAsync(aggregateToDelete);

var domainEvent = new ContributorDeletedEvent(contributorId);
await _mediator.Publish(domainEvent);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public static class DataSchemaConstants
{
public const int DEFAULT_NAME_LENGTH = 100;
public const int DefaultNameLength = 100;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ namespace Clean.Architecture.Infrastructure.Data.Config;

[EfCoreConverter<ContributorId>]
[EfCoreConverter<ContributorName>]
internal partial class VogenEfCoreConverters;
internal sealed partial class VogenEfCoreConverters;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override async ValueTask<int> SavedChangesAsync(SaveChangesCompletedEvent
// Retrieve all tracked entities that have domain events
var entitiesWithEvents = appDbContext.ChangeTracker.Entries<HasDomainEventsBase>()
.Select(e => e.Entity)
.Where(e => e.DomainEvents.Any())
.Where(e => e.DomainEvents.Count != 0)
.ToArray();

// Dispatch and clear domain events
Expand Down
4 changes: 2 additions & 2 deletions src/Clean.Architecture.Infrastructure/Data/SeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Clean.Architecture.Infrastructure.Data;

public static class SeedData
{
public const int NUMBER_OF_CONTRIBUTORS = 27; // including the 2 below
public const int NumberOfContributors = 27; // including the 2 below
public static readonly ContributorName Contributor1Name = ContributorName.From("Ardalis");
public static readonly ContributorName Contributor2Name = ContributorName.From("Ilyana");

Expand All @@ -22,7 +22,7 @@ public static async Task PopulateTestDataAsync(AppDbContext dbContext)
await dbContext.Database.ExecuteSqlInterpolatedAsync($"INSERT INTO [Contributors] ([Name], [Status]) VALUES ({Contributor2Name.Value}, {ContributorStatus.NotSet.Value})");

// Add a bunch more contributors to support demonstrating paging.
for (int i = 1; i <= NUMBER_OF_CONTRIBUTORS - 2; i++)
for (int i = 1; i <= NumberOfContributors - 2; i++)
{
await dbContext.Database.ExecuteSqlInterpolatedAsync($"INSERT INTO [Contributors] ([Name], [Status]) VALUES ({$"Contributor {i}"}, {ContributorStatus.NotSet.Value})");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Clean.Architecture.Infrastructure.Email;
public class FakeEmailSender(ILogger<FakeEmailSender> logger) : IEmailSender
{
private readonly ILogger<FakeEmailSender> _logger = logger;
public Task SendEmailAsync(string to, string from, string subject, string body)
public Task SendEmailAsync(string recipientEmail, string senderEmail, string subject, string body)
{
_logger.LogInformation("Not actually sending an email to {to} from {from} with subject {subject}", to, from, subject);
_logger.LogInformation("Not actually sending an email to {To} from {From} with subject {Subject}", recipientEmail, senderEmail, subject);
return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ public class MimeKitEmailSender(ILogger<MimeKitEmailSender> logger,
private readonly ILogger<MimeKitEmailSender> _logger = logger;
private readonly MailserverConfiguration _mailserverConfiguration = mailserverOptions.Value!;

public async Task SendEmailAsync(string to, string from, string subject, string body)
public async Task SendEmailAsync(string recipientEmail, string senderEmail, string subject, string body)
{
_logger.LogWarning("Sending email to {to} from {from} with subject {subject} using {type}.", to, from, subject, this.ToString());
_logger.LogWarning("Sending email to {To} from {From} with subject {Subject} using {Type}.", recipientEmail, senderEmail, subject, this.ToString());

using var client = new MailKit.Net.Smtp.SmtpClient();
await client.ConnectAsync(_mailserverConfiguration.Hostname,
using var client = new MailKit.Net.Smtp.SmtpClient();
await client.ConnectAsync(_mailserverConfiguration.Hostname,
_mailserverConfiguration.Port, false);
var message = new MimeMessage();
message.From.Add(new MailboxAddress(from, from));
message.To.Add(new MailboxAddress(to, to));
message.From.Add(new MailboxAddress(senderEmail, senderEmail));
message.To.Add(new MailboxAddress(recipientEmail, recipientEmail));
message.Subject = subject;
message.Body = new TextPart("plain") { Text = body };

await client.SendAsync(message);

await client.DisconnectAsync(true,
await client.DisconnectAsync(true,
new CancellationToken(canceled: true));
}
}
11 changes: 6 additions & 5 deletions src/Clean.Architecture.ServiceDefaults/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.ServiceDiscovery;
using OpenTelemetry;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
Expand Down Expand Up @@ -34,12 +33,13 @@ public static TBuilder AddServiceDefaults<TBuilder>(this TBuilder builder) where
// Turn on service discovery by default
http.AddServiceDiscovery();
});

#pragma warning disable S125 // This template intentionally contains commented sample configuration.
// Uncomment the following to restrict the allowed schemes for service discovery.
// builder.Services.Configure<ServiceDiscoveryOptions>(options =>
// {
// options.AllowedSchemes = ["https"];
// });
#pragma warning restore S125

return builder;
}
Expand All @@ -65,8 +65,8 @@ public static TBuilder ConfigureOpenTelemetry<TBuilder>(this TBuilder builder) w
.AddAspNetCoreInstrumentation(tracing =>
// Exclude health check requests from tracing
tracing.Filter = context =>
!context.Request.Path.StartsWithSegments(HealthEndpointPath)
&& !context.Request.Path.StartsWithSegments(AlivenessEndpointPath)
!context.Request.Path.StartsWithSegments(HealthEndpointPath, StringComparison.OrdinalIgnoreCase)
&& !context.Request.Path.StartsWithSegments(AlivenessEndpointPath, StringComparison.OrdinalIgnoreCase)
)
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
//.AddGrpcClientInstrumentation()
Expand All @@ -86,13 +86,14 @@ private static TBuilder AddOpenTelemetryExporters<TBuilder>(this TBuilder builde
{
builder.Services.AddOpenTelemetry().UseOtlpExporter();
}

#pragma warning disable S125 //this is there on purpose to show how to conditionally add exporters based on configuration, and to avoid confusion about the presence of multiple exporters in this template.
// Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package)
//if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
//{
// builder.Services.AddOpenTelemetry()
// .UseAzureMonitor();
//}
#pragma warning restore

return builder;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Clean.Architecture.UseCases/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Clean.Architecture.UseCases;

public class Constants
public static class Constants
{
public const int DEFAULT_PAGE_SIZE = 10;
public const int MAX_PAGE_SIZE = 100;
public const int DefaultPageSize = 10;
public const int MaxPageSize = 100;
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
using Clean.Architecture.Core.ContributorAggregate;
using Clean.Architecture.Core.ContributorAggregate.Specifications;
using Clean.Architecture.UseCases.Contributors.GetContributor;

namespace Clean.Architecture.UseCases.Contributors.Get;

Check warning on line 5 in src/Clean.Architecture.UseCases/Contributors/Get/GetContributorHandler.cs

View workflow job for this annotation

GitHub Actions / Build & Test (.NET 10) (ubuntu-latest, Release)

Rename namespace Clean.Architecture.UseCases.Contributors.Get so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a namespace makes it harder for consumers in other languages to use the namespace. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

Check warning on line 5 in src/Clean.Architecture.UseCases/Contributors/Get/GetContributorHandler.cs

View workflow job for this annotation

GitHub Actions / Build & Test (.NET 10) (ubuntu-latest, Release)

Rename namespace Clean.Architecture.UseCases.Contributors.Get so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a namespace makes it harder for consumers in other languages to use the namespace. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

Check warning on line 5 in src/Clean.Architecture.UseCases/Contributors/Get/GetContributorHandler.cs

View workflow job for this annotation

GitHub Actions / Build & Test (.NET 10) (macos-latest, Release)

Rename namespace Clean.Architecture.UseCases.Contributors.Get so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a namespace makes it harder for consumers in other languages to use the namespace. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

Check warning on line 5 in src/Clean.Architecture.UseCases/Contributors/Get/GetContributorHandler.cs

View workflow job for this annotation

GitHub Actions / Build & Test (.NET 10) (macos-latest, Release)

Rename namespace Clean.Architecture.UseCases.Contributors.Get so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a namespace makes it harder for consumers in other languages to use the namespace. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

Check warning on line 5 in src/Clean.Architecture.UseCases/Contributors/Get/GetContributorHandler.cs

View workflow job for this annotation

GitHub Actions / Build & Test (.NET 10) (windows-latest, Release)

Rename namespace Clean.Architecture.UseCases.Contributors.Get so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a namespace makes it harder for consumers in other languages to use the namespace. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

Check warning on line 5 in src/Clean.Architecture.UseCases/Contributors/Get/GetContributorHandler.cs

View workflow job for this annotation

GitHub Actions / Build & Test (.NET 10) (windows-latest, Release)

Rename namespace Clean.Architecture.UseCases.Contributors.Get so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a namespace makes it harder for consumers in other languages to use the namespace. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716)

/// <summary>
/// Queries don't necessarily need to use repository methods, but they can if it's convenient
/// </summary>
public class GetContributorHandler(IReadRepository<Contributor> _repository)
public class GetContributorHandler(IReadRepository<Contributor> repository)
: IQueryHandler<GetContributorQuery, Result<ContributorDto>>
{
public async ValueTask<Result<ContributorDto>> Handle(GetContributorQuery request, CancellationToken cancellationToken)
{
var spec = new ContributorByIdSpec(request.ContributorId);
var entity = await _repository.FirstOrDefaultAsync(spec, cancellationToken);
var entity = await repository.FirstOrDefaultAsync(spec, cancellationToken);
if (entity == null) return Result.NotFound();

return new ContributorDto(entity.Id, entity.Name, entity.PhoneNumber ?? PhoneNumber.Unknown);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Clean.Architecture.Core.ContributorAggregate;

namespace Clean.Architecture.UseCases.Contributors.Get;
namespace Clean.Architecture.UseCases.Contributors.GetContributor;

public record GetContributorQuery(ContributorId ContributorId) : IQuery<Result<ContributorDto>>;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public async ValueTask<Result<PagedResult<ContributorDto>>> Handle(ListContribut
CancellationToken cancellationToken)
{

var result = await _query.ListAsync(request.Page ?? 1, request.PerPage ?? Constants.DEFAULT_PAGE_SIZE);
var result = await _query.ListAsync(request.Page ?? 1, request.PerPage ?? Constants.DefaultPageSize);

return Result.Success(result);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Clean.Architecture.UseCases.Contributors.List;

public record ListContributorsQuery(int? Page = 1, int? PerPage = Constants.DEFAULT_PAGE_SIZE)
public record ListContributorsQuery(int? Page = 1, int? PerPage = Constants.DefaultPageSize)
: IQuery<Result<PagedResult<ContributorDto>>>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ namespace Clean.Architecture.UseCases.Contributors.Update;
public class UpdateContributorHandler(IRepository<Contributor> _repository)
: ICommandHandler<UpdateContributorCommand, Result<ContributorDto>>
{
public async ValueTask<Result<ContributorDto>> Handle(UpdateContributorCommand command,
CancellationToken ct)
public async ValueTask<Result<ContributorDto>> Handle(UpdateContributorCommand command,
CancellationToken cancellationToken)
{
var existingContributor = await _repository.GetByIdAsync(command.ContributorId, ct);
var existingContributor = await _repository.GetByIdAsync(command.ContributorId, cancellationToken);
if (existingContributor == null)
{
return Result.NotFound();
}

existingContributor.UpdateName(command.NewName);

await _repository.UpdateAsync(existingContributor, ct);
await _repository.UpdateAsync(existingContributor, cancellationToken);

return new ContributorDto(existingContributor.Id,
existingContributor.Name, existingContributor.PhoneNumber ?? PhoneNumber.Unknown);
Expand Down
5 changes: 3 additions & 2 deletions src/Clean.Architecture.Web/Configurations/LoggerConfigs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Serilog;
using System.Globalization;
using Serilog;

namespace Clean.Architecture.Web.Configurations;

Expand All @@ -12,7 +13,7 @@ public static WebApplicationBuilder AddLoggerConfigs(this WebApplicationBuilder
.ReadFrom.Configuration(builder.Configuration)
.Enrich.FromLogContext()
.Enrich.WithProperty("Application", builder.Environment.ApplicationName)
.WriteTo.Console()
.WriteTo.Console(formatProvider: CultureInfo.InvariantCulture)
.CreateLogger());

return builder;
Expand Down
Loading
Loading