Пример #1
0
        static void Main(string[] args)
        {
            Console.Title = "Client";

            var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client  = new ZodiacService.ZodiacServiceClient(channel);

            Console.WriteLine("Date of birth: ");
            var      dobInput = Console.ReadLine();
            DateTime date;

            try
            {
                string dateFormat = "MM/dd/yyyy";
                date = DateTime.ParseExact(dobInput, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None);

                var response = client.ZodiacSignInfo(new DOBRequest
                {
                    Data = dobInput
                });
                Console.WriteLine(response.Message);
            }
            catch (Exception)
            {
                Console.WriteLine("The date introduced is invalid!");
            }
            //Console.ReadLine();
            channel.ShutdownAsync().Wait();
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Channel channel = new Channel("localhost:50002", ChannelCredentials.Insecure);

            var client       = new ZodiacService.ZodiacServiceClient(channel);
            var birthRequest = getBirthday();

            var reply = client.ZodieFinder(birthRequest);

            Console.WriteLine("Zodie : " + reply.Sign);

            Console.ReadKey();
            channel.ShutdownAsync().Wait();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            Channel channel = new Channel("localhost:88888", ChannelCredentials.Insecure);

            var client = new ZodiacService.ZodiacServiceClient(channel);

            var birthRequest = PromptBirthday();

            var reply = client.findZodie(birthRequest);

            Console.WriteLine("Season: " + reply.Season + " || Sign: " + reply.Sign);

            Console.ReadKey();
            channel.ShutdownAsync().Wait();
        }