This code not work
public class UpdateDeviceRequest : IRequest<bool>, IRemoteRequest
{
public string IP { get; set; }
public string Name { get; set; }
public string Model { get; set; }
public IEnumerable<string> SpanRoles => ["public-api"];
}
services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<Program>());
services.AddRemoteMediatR<IGrpcMediator, GrpcMediator>("public-api", "grpc", remoteBuilder =>
{
foreach (var section in config.GetRequiredSection("grpc").GetChildren())
{
remoteBuilder.AddGrpcStrategy(section.Key, client => client.Address = new Uri(section.Value!));
}
});
But this code work
services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<Program>());
services.AddRemoteMediatR<IGrpcMediator, GrpcMediator>("public-api", "grpc", remoteBuilder =>
{
foreach (var section in config.GetRequiredSection("grpc").GetChildren())
{
remoteBuilder.AddGrpcStrategy(section.Key, client => client.Address = new Uri(section.Value!));
}
});
// Add some garbage rule in same protocalName
services.AddRemoteMediatR<IGrpcMediator, GrpcMediator>("gg", "grpc", remoteBuilder =>
{
});
If doesn't add garbage, options.Get(request.ProtocolName) will get public-api
and this line will remove public-api from roles
|
var excepted = roles.Except(nextSpans); |
This code not work
But this code work
If doesn't add garbage, options.Get(request.ProtocolName) will get
public-apiand this line will remove
public-apifrom rolesMediatR-Remote/src/MediatR.Remote/RemoteMediatorCommandHandlerBase.cs
Line 11 in e49d651