public IActionResult GetCount() { var request = new ContactGetCount(); using (var rpcClient = new ContactRpcClient <ContactGetCount, ContactGetCountResponse>(_connectionFactory, _encoding)) { var response = rpcClient.RemoteCall(request); return(Ok(response.Count)); } }
private ContactGetCountResponse WorkHandler(ContactGetCount request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } var count = _contactRepository.GetCount(); var response = new ContactGetCountResponse(count) { CorrelationId = request.CorrelationId }; return(response); }