Skip to content

Commit

Permalink
Bump Castle.Core from 5.1.1 to 5.2.1 (#1036)
Browse files Browse the repository at this point in the history
* Bump Castle.Core from 5.1.1 to 5.2.1

Bumps [Castle.Core](https://github.com/castleproject/Core) from 5.1.1 to 5.2.1.
- [Release notes](https://github.com/castleproject/Core/releases)
- [Changelog](https://github.com/castleproject/Core/blob/master/CHANGELOG.md)
- [Commits](castleproject/Core@v5.1.1...v5.2.1)

---
updated-dependencies:
- dependency-name: Castle.Core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* make it compile

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Hamulyák <max@kaylumah.nl>
  • Loading branch information
dependabot[bot] and kaylumah authored Mar 10, 2025
1 parent d05cc29 commit dd96d05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Bogus" Version="35.6.2" />
<PackageVersion Include="Castle.Core" Version="5.1.1" />
<PackageVersion Include="Castle.Core" Version="5.2.1" />
<PackageVersion Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
<PackageVersion Include="CsvHelper" Version="33.0.1" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.74" />
Expand Down
6 changes: 4 additions & 2 deletions src/Utilities/Common/LoggingInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ async Task InterceptAsynchronousInternal(IInvocation invocation, Stopwatch stopw
try
{
invocation.Proceed(); // Execute the original method
Task? task = (Task)invocation.ReturnValue;
Task? task = (Task?)invocation.ReturnValue;
Debug.Assert(task != null);
await task.ConfigureAwait(false); // Await the task's completion
}
finally
Expand All @@ -50,7 +51,8 @@ async Task<TResult> InterceptAsynchronousInternal<TResult>(IInvocation invocatio
try
{
invocation.Proceed(); // Execute the original method
Task<TResult>? task = (Task<TResult>)invocation.ReturnValue;
Task<TResult>? task = (Task<TResult>?)invocation.ReturnValue;
Debug.Assert(task != null);
return await task.ConfigureAwait(false); // Await the task's completion and return its result
}
finally
Expand Down
9 changes: 6 additions & 3 deletions test/Unit/Utilities/MyInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE file in the project root for full license information.

using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Castle.DynamicProxy;
using Newtonsoft.Json;
Expand Down Expand Up @@ -42,15 +43,17 @@ async Task InternalInterceptAsynchronous(IInvocation invocation)
{
_ = invocation ?? throw new ArgumentNullException(nameof(invocation));
InternalIntercept(invocation);
Task task = (Task)invocation.ReturnValue;
Task? task = (Task?)invocation.ReturnValue;
Debug.Assert(task != null);
await task.ConfigureAwait(false);
}

async Task<TResult> InternalInterceptAsynchronous<TResult>(IInvocation invocation)
{
_ = invocation ?? throw new ArgumentNullException(nameof(invocation));
InternalIntercept(invocation);
Task<TResult> task = (Task<TResult>)invocation.ReturnValue;
Task<TResult>? task = (Task<TResult>?)invocation.ReturnValue;
Debug.Assert(task != null);
TResult returnValue = await task.ConfigureAwait(false);
// ValidateReturnValue(invocation, returnValue);
return returnValue;
Expand Down Expand Up @@ -78,7 +81,7 @@ void InternalIntercept(IInvocation invocation)
_ReqnrollOutputHelper.WriteLine(test);
if (invocation.Arguments is { Length: > 0 })
{
object first = invocation.Arguments[0];
object? first = invocation.Arguments[0];
string json = JsonConvert.SerializeObject(first);
_ReqnrollOutputHelper.WriteLine(json);
}
Expand Down

0 comments on commit dd96d05

Please sign in to comment.