Skip to content

Commit de132e3

Browse files
committed
Release new version of Functional.AspNetCore and Functional.Logger
1 parent 5306640 commit de132e3

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎src/Codehard.Functional/Codehard.Functional.AspNetCore/Codehard.Functional.AspNetCore.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<Version>3.0.1</Version>
7+
<Version>3.1.0</Version>
88
<Description>A library contains common code related to functional programming in ASP.NET Core based on LanguageExt.</Description>
99
<PackageProjectUrl>https://github.com/codehardth/Codehard.Functional</PackageProjectUrl>
1010
<RepositoryUrl>https://github.com/codehardth/Codehard.Functional</RepositoryUrl>

‎src/Codehard.Functional/Codehard.Functional.AspNetCore/ControllerExtensions.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static IActionResult MatchToResult<T>(
6969

7070
/// <summary>
7171
/// Match a Fin of Option <typeparamref name="T"/> into IActionResult.
72-
/// When option is none the NotFound status is returned.
72+
/// When the option is none, the NotFound status is returned.
7373
/// </summary>
7474
public static IActionResult MatchToResult<T>(
7575
this Fin<Option<T>> fin,
@@ -90,7 +90,7 @@ public static IActionResult MatchToResult<T>(
9090
logger?.Log(hre);
9191
return MapErrorToActionResult(hre);
9292
default:
93-
logger?.Log(err);
93+
logger?.Log(err, exceptionHandler: WebApiExceptionHandler.Handle);
9494
return MapErrorToActionResult(err);
9595
}
9696
});
@@ -118,7 +118,7 @@ public static ValueTask<IActionResult> RunToResultAsync<T>(
118118
}
119119

120120
/// <summary>
121-
/// Run the effect into IActionResult in a synchronous manner.
121+
/// Run the effect into IActionResult synchronously.
122122
/// </summary>
123123
public static IActionResult RunToResult<T>(
124124
this Eff<T> eff,

‎src/Codehard.Functional/Codehard.Functional.AspNetCore/LoggingExtesions.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static void Handle(ILogger logger, Error error, LogLevel logLevel = LogLe
6565
if (ex is OperationCanceledException or TaskCanceledException &&
6666
logLevel < LogLevel.Error)
6767
{
68-
logger.Log(logLevel, "{Message}", ex.Message);
68+
logger.Log(logLevel, exception: ex, message: "{Message}", ex.Message);
6969
}
7070
else
7171
{

‎src/Codehard.Functional/Codehard.Functional.Logger/Codehard.Functional.Logger.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<Version>2.5.0</Version>
7+
<Version>2.6.0</Version>
88
<Description>A library contains common code related to functional programming with logger based on LanguageExt.</Description>
99
<PackageProjectUrl>https://github.com/codehardth/Codehard.Functional</PackageProjectUrl>
1010
<RepositoryUrl>https://github.com/codehardth/Codehard.Functional</RepositoryUrl>

‎src/Codehard.Functional/Codehard.Functional.Logger/LoggerExtensions.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public static Unit Log(
7272
}
7373

7474
/// <summary>
75-
/// Log as error if an error contains exception, otherwise log information if there is a message within an error object.
76-
/// Then returns the error back.
75+
/// Log as an error if an error contains an exception, otherwise log information if there is a message within an error object.
76+
/// Then returns the error.
7777
/// </summary>
7878
/// <param name="logger"></param>
7979
/// <param name="error"></param>

‎src/Codehard.Infrastructure/Codehard.Infrastructure.EntityFramework.Tests/TestDbContext.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
6868

6969
public Task PublishDomainEventAsync(IDomainEvent domainEvent)
7070
{
71-
this.logger.LogInformation(domainEvent.ToString());
71+
this.logger.LogInformation("{Message}", domainEvent.ToString());
7272

7373
return Task.CompletedTask;
7474
}

0 commit comments

Comments
 (0)