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(); }
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(); }
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(); }