femto-backend/Femto.Modules.Blog/Application/BlogModule.cs
2025-05-21 00:19:49 +02:00

30 lines
826 B
C#

using Femto.Common.Domain;
using MediatR;
namespace Femto.Modules.Blog.Application;
internal class BlogModule(IMediator mediator) : IBlogModule
{
public async Task Command(ICommand command, CancellationToken cancellationToken = default)
{
await mediator.Send(command, cancellationToken);
}
public async Task<TResponse> Command<TResponse>(
ICommand<TResponse> command,
CancellationToken cancellationToken = default
)
{
var response = await mediator.Send(command, cancellationToken);
return response;
}
public async Task<TResponse> Query<TResponse>(
IQuery<TResponse> query,
CancellationToken cancellationToken = default
)
{
var response = await mediator.Send(query, cancellationToken);
return response;
}
}