Beispiel #1
0
 public override Task <CounterReply> IncrementCount(Empty request, ServerCallContext context)
 {
     _logger.LogInformation("Incrementing count by 1");
     _counter.Increment(1);
     return(Task.FromResult(new CounterReply {
         Count = _counter.Count
     }));
 }
Beispiel #2
0
        public override Task <CounterReply> IncrementCount(Empty request, ServerCallContext context)
        {
            var httpContext = context.GetHttpContext();

            _logger.LogInformation($"Connection id: {httpContext.Connection.Id}");

            _logger.LogInformation("Incrementing count by 1");
            _counter.Increment(1);
            return(Task.FromResult(new CounterReply {
                Count = _counter.Count
            }));
        }