Exemplo n.º 1
0
    /// <inheritdoc />
    public override Task <GetAllProjectionsResponse> GetAll(GetAllProjectionsRequest request, ServerCallContext context)
    {
        Log.GetAll(_logger);
        var response = new GetAllProjectionsResponse();

        response.Projections.AddRange(_projections.All.Select(_ => CreateStatusFromInfo(_, request.TenantId?.ToGuid())));
        return(Task.FromResult(response));
    }
Exemplo n.º 2
0
    /// <inheritdoc />
    public async Task <IEnumerable <ProjectionStatus> > GetAll(MicroserviceAddress runtime, TenantId tenant = null)
    {
        var client  = _clients.CreateClientFor <ProjectionsClient>(runtime);
        var request = new GetAllProjectionsRequest
        {
            TenantId = tenant?.ToProtobuf()
        };

        var response = await client.GetAllAsync(request);

        if (response.Failure != null)
        {
            throw new GetAllProjectionsFailed(response.Failure.Reason);
        }

        return(response.Projections.Select(CreateProjectionStatus));
    }