Пример #1
0
        public Expression Build(Expression source, ref OeSelectTranslatorParameters parameters)
        {
            BuildSelect(_odataUri.SelectAndExpand, parameters.MetadataLevel);
            BuildCompute(_odataUri.Compute);

            source = BuildSkipTakeSource(source, parameters.SkipTokenNameValues, parameters.IsDatabaseNullHighestValue);
            source = BuildJoin(source, FlattenNavigationItems(_rootNavigationItem, false));
            source = BuildOrderBy(source, _odataUri.OrderBy);
            source = SelectStructuralProperties(source, _rootNavigationItem);
            return(CreateSelectExpression(source));
        }
Пример #2
0
        public Expression ApplySelect(Expression source, OeQueryContext queryContext)
        {
            if (queryContext.ODataUri.Path.LastSegment is CountSegment)
            {
                return(source);
            }

            var selectTranslator           = new Translators.OeSelectTranslator(queryContext.EdmModel, _joinBuilder, queryContext.ODataUri);
            var selectTranslatorParameters = new Translators.OeSelectTranslatorParameters()
            {
                IsDatabaseNullHighestValue = queryContext.IsDatabaseNullHighestValue,
                MetadataLevel       = queryContext.MetadataLevel,
                SkipTokenNameValues = queryContext.SkipTokenNameValues
            };

            source = selectTranslator.Build(source, ref selectTranslatorParameters, out _entryFactoryFactory);

            ChangeParameterType(source);
            return(source);
        }