Biss.Mediator.Abstractions
1.1.0
dotnet add package Biss.Mediator.Abstractions --version 1.1.0
NuGet\Install-Package Biss.Mediator.Abstractions -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Biss.Mediator.Abstractions" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Biss.Mediator.Abstractions" Version="1.1.0" />
<PackageReference Include="Biss.Mediator.Abstractions" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Biss.Mediator.Abstractions --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Biss.Mediator.Abstractions, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Biss.Mediator.Abstractions@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Biss.Mediator.Abstractions&version=1.1.0
#tool nuget:?package=Biss.Mediator.Abstractions&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Biss.Mediator.Abstractions
Interfaces e contratos base para o padrão Mediator em .NET 9.
📦 Instalação
dotnet add package Biss.Mediator.Abstractions
🎯 O que é este pacote?
Este é o pacote base do Biss.Mediator. Ele contém apenas as interfaces e tipos fundamentais:
IMediator- Interface principal do mediatorIRequest<TResponse>- Interface para requests com retornoICommand/ICommand<TResponse>- Interfaces para commandsIQuery<TResponse>- Interface para queriesINotification- Interface para notificaçõesIRequestHandler<TRequest, TResponse>- Interface para handlersIPipelineBehavior<TRequest, TResponse>- Interface para pipeline behaviorsResult<T>- Tipo para resultados com sucesso/erroError- Sistema de erros tipado
🚀 Uso Básico
using Biss.Mediator.Abstractions;
// Definir um command
public record CreateUserCommand(string Name, string Email) : ICommand<UserId>;
// Definir um query
public record GetUserQuery(Guid Id) : IQuery<UserDto>;
// Definir um handler
public class CreateUserHandler : ICommandHandler<CreateUserCommand, UserId>
{
public async Task<Result<UserId>> Handle(
CreateUserCommand request,
CancellationToken cancellationToken)
{
// Sua lógica aqui
return Result<UserId>.Success(new UserId(Guid.NewGuid()));
}
}
📚 Próximos Passos
Para usar o Mediator, você também precisa:
- Biss.Mediator - Implementação do mediator
- Biss.Mediator.Extensions.DependencyInjection - Para registro no DI container
- Biss.Mediator.Extensions.AspNetCore - Para uso em ASP.NET Core (opcional)
🔗 Links
📄 Licença
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Biss.Mediator.Abstractions:
| Package | Downloads |
|---|---|
|
Biss.Mediator.Extensions.DependencyInjection
High-performance Mediator and Mapper components for .NET 9 |
|
|
Biss.Mediator
High-performance Mediator and Mapper components for .NET 9 |
|
|
Biss.Mediator.Extensions.AspNetCore
High-performance Mediator and Mapper components for .NET 9 |
|
|
Biss.Mediator.Behaviors
High-performance Mediator and Mapper components for .NET 9 |
GitHub repositories
This package is not used by any popular GitHub repositories.