Esempio n. 1
0
        private static ResultWrapper <RestrictionReadDto> CreateResultWrapper(RestrictionReadDto readDto, string fieldName)
        {
            ResultWrapper <RestrictionReadDto> resultWrapper = new ResultWrapper <RestrictionReadDto>();

            if (readDto == null)
            {
                resultWrapper.AddError(ErrorFactory.CreateError(ErrorType.Id, fieldName));
            }

            resultWrapper.SetResult(readDto);
            return(resultWrapper);
        }
Esempio n. 2
0
        private static ResultWrapper <ProductReadDto> CreateResultWrapper(ProductReadDto finishReadDto)
        {
            ResultWrapper <ProductReadDto> resultWrapper = new ResultWrapper <ProductReadDto>();

            if (finishReadDto == null)
            {
                resultWrapper.AddError(ErrorFactory.CreateError(ErrorType.Id, nameof(Product.Id)));
            }

            resultWrapper.SetResult(finishReadDto);
            return(resultWrapper);
        }