20 lines
593 B
C#
20 lines
593 B
C#
using IM.Commons;
|
|
using IM.Protocols.Grpc.Conversation;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace ConnectorService
|
|
{
|
|
public class ModuleInit : IModuleInitializer
|
|
{
|
|
public void Initialize(IServiceCollection services)
|
|
{
|
|
services.AddRedisCache();
|
|
services.AddGrpcClient<ConversationInternal.ConversationInternalClient>((sp ,o) =>
|
|
{
|
|
var options = sp.GetRequiredService<IOptionsMonitor<GrpcOptions>>();
|
|
o.Address = new Uri(options.CurrentValue.MessageServiceUrl);
|
|
});
|
|
}
|
|
}
|
|
}
|