Example #1
0
        public override async Task <MessageResponse> Load(LoadRequest request, ServerCallContext context)
        {
            using (var scope = _scopeFactory.CreateScope())
            {
                var mediator = scope.ServiceProvider.GetRequiredService <IMediator>();
                var message  = await mediator.Send(new MessageByIdQuery(request.Id));

                return(ToResponse(message));
            }
        }
Example #2
0
        public override async Task <MessageResponse> Load(LoadRequest request, ServerCallContext context)
        {
            var message = await _mediator.Send(new MessageByIdQuery(request.Id));

            return(ToResponse(message));
        }