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:
2025-12-17 10:41:04 +01:00
parent 73ccb9e43b
commit ac4c4cb69a

View 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
{
}