dotnet-cqrs/Svrnty.CQRS.Grpc.Sample/InternalCommand.cs

22 lines
666 B
C#

using Svrnty.CQRS.Abstractions;
using Svrnty.CQRS.Grpc.Abstractions.Attributes;
namespace Svrnty.CQRS.Grpc.Sample;
// This command is marked with [GrpcIgnore] so it won't be exposed via gRPC
[GrpcIgnore]
public record InternalCommand
{
public string Data { get; set; } = string.Empty;
}
public class InternalCommandHandler : ICommandHandler<InternalCommand>
{
public Task HandleAsync(InternalCommand command, CancellationToken cancellationToken = default)
{
// This is an internal command that should not be exposed via gRPC
Console.WriteLine($"Processing internal command: {command.Data}");
return Task.CompletedTask;
}
}