public IActionResult CurrentTime() { var time = _iTimeService.GetCurrentTime(); _logger.LogInformation($"new time {time}"); return(Ok(time)); }
static void Main(string[] args) { using (ChannelFactory <ITime> channelFactory = new ChannelFactory <ITime>("timeService")) { ITime proxy = channelFactory.CreateChannel(); for (int i = 0; i < 5; i++) { Console.WriteLine(proxy.GetCurrentTime().ToLongTimeString()); Thread.Sleep(1000); } } Console.Read(); }