public static IEnumerable <KeyValuePair <string, string> > AsODataQueryStringArguments <T>(this IQueryable <T> queryable)
        {
            if (queryable is null)
            {
                throw new ArgumentNullException(nameof(queryable));
            }

            var client = new ArgumentCapturingODataDataClient();
            ODataExpressionConverterSettings settings = ODataExpressionConverterSettings.Default;

            if (queryable.Provider is ODataQueryProvider <T> p)
            {
                settings = p.Settings;
            }

            var provider = new ODataQueryProvider <T>(client, settings);

            provider.Execute(queryable.Expression);

            return(client.QueryStringParamaters);
        }
Пример #2
0
 internal ODataQueryable(ODataQueryProvider <TType> queryProvider, ODataExpressionConverterSettings settings, Expression expression)
 {
     Provider      = queryProvider;
     Expression    = expression;
     this.settings = settings;
 }
Пример #3
0
 internal ODataQueryable(IODataDataClient client, ODataExpressionConverterSettings settings, Expression expression)
     : this(new ODataQueryProvider <TType>(client, settings), settings, expression)
 {
 }
Пример #4
0
 public ODataQueryable(IODataDataClient client, ODataExpressionConverterSettings settings)
     : this(new ODataQueryProvider <TType>(client, settings), settings, null)
 {
     Expression = Expression.Constant(this);
 }