Exemplo n.º 1
0
 public static void AddEmailGeneratorClient(this IServiceCollection services)
 {
     services.AddSingleton <EmailGenerator>();
     services.AddSingleton(s =>
     {
         var config  = s.GetService <IOptions <EmailGeneratorConfiguration> >().Value;
         var channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure);
         var client  = new EmailGeneratorClient(channel);
         return(client);
     });
 }
Exemplo n.º 2
0
 public EmailGenerator(EmailGeneratorClient client, ILogger <EmailGenerator> logger)
 {
     _client = client;
     _logger = logger;
 }