Skip to content

Commit 994e978

Browse files
Fixed commands bus interface
1 parent e920491 commit 994e978

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<IsPackable>true</IsPackable>
7-
<Version>2.1.18</Version>
7+
<Version>2.1.19</Version>
88
<Authors>Andrey Serdyuk</Authors>
99
<Company>TaskHub</Company>
1010
<PackageTags>#TaskHub</PackageTags>

TaskHub.Shared.Commands.Abstractions/Behavior/IBehavior.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace TaskHub.Shared.Commands.Abstractions.Behavior;
55

66
public interface IBehavior<TCommand, TResult>
77
where TCommand : ICommand
8-
where TResult : Result
8+
where TResult : ResultBase
99
{
1010
Task<TResult> HandleAsync(TCommand command, Func<TCommand, CancellationToken, Task<TResult>> next, CancellationToken ct);
1111
}

TaskHub.Shared.Commands.Abstractions/Bus/ICommandsBus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ public interface ICommandsBus
77
{
88
Task<TResult> SendAsync<TCommand, TResult>(TCommand request, CancellationToken ct)
99
where TCommand : ICommand
10-
where TResult : Result;
10+
where TResult : ResultBase;
1111
}

TaskHub.Shared.Commands.Abstractions/Handler/ICommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace TaskHub.Shared.Commands.Abstractions.Handler;
55

66
public interface ICommandHandler<in TRequest, TResponse>
77
where TRequest : ICommand
8-
where TResponse : Result
8+
where TResponse : ResultBase
99
{
1010
Task<TResponse> HandleAsync(TRequest request, CancellationToken ct);
1111
}

TaskHub.Shared.Commands.Bus/CommandsBus.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public sealed class CommandsBus(IServiceScopeFactory factory) : ICommandsBus
1414

1515
public async Task<TResult> SendAsync<TCommand, TResult>(TCommand request, CancellationToken ct)
1616
where TCommand : ICommand
17-
where TResult : Result
17+
where TResult : ResultBase
1818
{
1919
var invokerObj = _invokers.GetOrAdd((typeof(TCommand), typeof(TResult)), _ => CreateInvoker<TCommand, TResult>());
2020
var invoker = (Func<IServiceProvider, TCommand, CancellationToken, Task<TResult>>)invokerObj;
@@ -24,7 +24,7 @@ public async Task<TResult> SendAsync<TCommand, TResult>(TCommand request, Cancel
2424

2525
private static Func<IServiceProvider, TCommand, CancellationToken, Task<TResult>> CreateInvoker<TCommand, TResult>()
2626
where TCommand : ICommand
27-
where TResult : Result =>
27+
where TResult : ResultBase =>
2828
static async (sp, request, ct) =>
2929
{
3030
ct.ThrowIfCancellationRequested();

0 commit comments

Comments
 (0)