Example #1
0
        public async Task <IActionResult> Produce(ListOperatorActivityRequest request)
        {
            var validationResult = await _validationArrangement.Validate(request);

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

            return(actionResult);
        }
Example #2
0
        public ListOperatorActivityQuery Map(ListOperatorActivityRequest request)
        {
            var result = new ListOperatorActivityQuery(request.Filter,
                                                       request.Top,
                                                       request.Skip);

            return(result);
        }
        public async Task <IActionResult> List([FromQuery] ListOperatorActivityFromQuery query)
        {
            var request = new ListOperatorActivityRequest(query);

            var result = await _apiResult.Produce(request);

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

            if (validatorActionResult.Result == null)
            {
                var call = _cqsMapper.Map(request);

                var result = await _mediator.Send(call);

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

            return actionResult;
        }