Exemplo n.º 1
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var grpcChannel = GrpcChannel.ForAddress("https://localhost:5001");
            var client      = new Notifier.Notifier.NotifierClient(grpcChannel);
            var reply       = await client.NotifyAsync(new NotificationRequest
                                                       { Id = 666, Content = "Hello from small client!" });

            Console.WriteLine($"Reply: {reply.Result}");
            Console.ReadKey();
        }
Exemplo n.º 2
0
 public void SendNotification(Notification notification)
 {
     try
     {
         var grpcChannel = GrpcChannel.ForAddress("https://localhost:5002");
         var client      = new Notifier.Notifier.NotifierClient(grpcChannel);
         var status      = client.Notify(new NotifyRequest
         {
             Mail  = notification.UserMail,
             Name  = notification.UserName,
             Phone = notification.UserPhone
         });
     }
     catch (Exception exception)
     {
         _logger.LogError("Ups!");
     }
 }