Ejemplo n.º 1
0
        public async Task <IActionResult> Process(ListTeamRequest request, IValidatorActionResult validatorActionResult)
        {
            IActionResult actionResult;

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

                var query  = _cqsMapper.Map(request);
                var result = await _mediator.Send(query);

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

            return(actionResult);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Process(ListRequest request, IValidatorActionResult validatorActionResult)
        {
            IActionResult actionResult;

            if (validatorActionResult.Result == null)
            {
                request.UpdateFilter(fromToSet: new Dictionary <string, string> {
                    { "login", "Login/Value" },
                    { "firstName", "fullName/firstName/value" },
                    { "lastName", "fullName/lastName/value" },
                    { "version", "dissalowed" },
                });

                var call = _cqsMapper.Map(request);

                var result = await _mediator.Send(call);

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

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

            if (validatorActionResult.Result == null)
            {
                request.Unescape();

                var call = _cqsMapper.Map(request);

                var result = await _mediator.Send(call);

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

            return(actionResult);
        }
        public async Task<IActionResult> Process(ListStorageStatusRequest 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<StorageStatusesModel>)result).Value);
            }
            else
            {
                actionResult = validatorActionResult.Result;
            }

            return actionResult;
        }