Add generic scoped request interfaces for MediatR support
Introduced IScopedRequestBase<TScope>, IScopedRequest<TScope>, and IScopedRequest<TScope, TResponse> interfaces to enable requests with scope information. These interfaces extend MediatR's IRequest types and enforce non-nullable scope types for improved request handling.
This commit is contained in:
16
src/ReC.Application/Common/Interfaces/IScopedRequest.cs
Normal file
16
src/ReC.Application/Common/Interfaces/IScopedRequest.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using MediatR;
|
||||
|
||||
namespace ReC.Application.Common.Interfaces;
|
||||
|
||||
public interface IScopedRequestBase<TScope> where TScope : notnull
|
||||
{
|
||||
public TScope Scope { get; }
|
||||
}
|
||||
|
||||
public interface IScopedRequest<TScope> : IRequest, IScopedRequestBase<TScope> where TScope : notnull
|
||||
{
|
||||
}
|
||||
|
||||
public interface IScopedRequest<TScope, out TResponse> : IRequest<TResponse>, IScopedRequestBase<TScope> where TScope : notnull
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user