Example #1
0
        public Task <PipelineResponse <CreateModelRetriever.Response> > Retrieve(ModelRequest input)
        {
            // var response = PipelineResponse<CreateModelPipeline.Response, string>.Fail("error-response");
            var response = PipelineResponse.Ok <CreateModelRetriever.Response>(new CreateModelRetriever.Response("new-model-id"));

            return(Task.FromResult(response));
        }
Example #2
0
            public Task <PipelineResponse <ModelResponse> > Retrieve(ModelRequest input)
            {
                _times++;

                return(Task.FromResult(PipelineResponse.Ok(new ModelResponse {
                    Name = _times.ToString()
                })));
            }
            public Task <PipelineResponse <ModelResponse> > Retrieve(BodyRequest input)
            {
                var response = new ModelResponse
                {
                    Name = $"Id = {input.Id}, Body = {input.Body}",
                };

                return(Task.FromResult(PipelineResponse.Ok(response)));
            }
Example #4
0
            public async Task <PipelineResponse <ModelResponse> > Retrieve(ModelRequest input)
            {
                try
                {
                    var response = await _dbThing.GetModel(input);

                    return(PipelineResponse.Ok <ModelResponse>(response));
                }
                catch (Exception ex)
                {
                    return(PipelineResponse.Fail <ModelResponse>(ex, "Unhandled exception"));
                }
            }
Example #5
0
        public async Task <PipelineResponse <CreateUserResponse> > Retrieve(CreateUserRequest request)
        {
            var id = await _database.Create(request.Name);

            return(PipelineResponse.Ok(new CreateUserResponse(id)));
        }
            public async Task <PipelineResponse <ModelResponse> > Retrieve(ModelRequest input)
            {
                var result = await _dbThing.GetModel(input);

                return(PipelineResponse.Ok(result));
            }
            public async Task <PipelineResponse <List <ModelResponse> > > Retrieve()
            {
                var result = await _dbThing.GetAll();

                return(PipelineResponse.Ok(result));
            }
Example #8
0
        public async Task <PipelineResponse <TOut> > Retrieve(TIn input)
        {
            var result = await _retriever(input);

            return(PipelineResponse.Ok(result));
        }