public async Task <IActionResult> List([FromQuery] ListSourceFromQuery query)
        {
            var request = new ListSourceRequest(query);

            var result = await _apiResult.Produce(request);

            return(result);
        }
Beispiel #2
0
        public async Task <IActionResult> Produce(ListSourceRequest request)
        {
            var validatorActionResult = await _validationArrangement.Validate(request);

            var actionResult = await _operationArrangement.Process(request, validatorActionResult);

            return(actionResult);
        }
Beispiel #3
0
        public ListSourceQuery Map(ListSourceRequest request)
        {
            var filter = request.Filter;
            var top    = request.Top;
            var skip   = request.Skip;

            var result = new ListSourceQuery(filter, top, skip);

            return(result);
        }
        public async Task<IActionResult> Process(ListSourceRequest request, IValidatorActionResult validatorActionResult)
        {
            IActionResult actionResult;

            if (validatorActionResult.Result == null)
            {
                request.UpdateFilter(fromToSet: new Dictionary<string, string>{
                        { "version", "dissalowed"}
                    });

                var call = _cqsMapper.Map(request);

                var result = await _mediator.Send(call);

                actionResult = result.IsFailure ? _apiResponse.Fail(result)
                                                : _apiResponse.Ok(((Result<SourcesModel>)result).Value);
            }
            else
            {
                actionResult = validatorActionResult.Result;
            }

            return actionResult;
        }