Example #1
0
        static async Task Main(string[] args)
        {
            using var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client = new Gateway.GatewayClient(channel);

            Console.Write("Type in your desired date: ");
            var input = Console.ReadLine();
            var date  = IsDateValid(input);

            if (date == null)
            {
                throw new ArgumentException("The date must be valid.");
            }

            var dateToBeSent = new ZodiacSignsService.Date()
            {
                Month = date.Month,
                Day   = date.Day,
                Year  = date.Year
            };

            var reply = await client.ProcessRequestAsync(
                new GatewayRequest
            {
                Date = dateToBeSent
            });;

            Console.WriteLine("The zodiac sign associated with that date is " + reply.ZodiacSign);
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }