public async Task<IActionResult> Process(ListLayoutRequest request, IValidatorActionResult validatorActionResult)
        {
            IActionResult actionResult;

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

                var call = _cqsMapper.Map(request);

                var result = await _mediator.Send(call);

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

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

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

            return(actionResult);
        }
        public async Task <IActionResult> List([FromQuery] ListLayoutFromQuery query)
        {
            var request = new ListLayoutRequest(query);

            var result = await _apiResult.Produce(request);

            return(result);
        }
Beispiel #4
0
        public ListLayoutQuery Map(ListLayoutRequest request)
        {
            var filter = request.Filter;
            var top    = request.Top;
            var skip   = request.Skip;

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

            return(result);
        }