Closed maximpashuk closed 6 years ago
@maximpashuk Support for optional $-sign for query is only available in master branch of WebAPI. And it is not released yet. Branch feature/netcore is under active development and doesn't have the parity with the WebAPI/master branch for this feature yet.
In beta4 ODataUriResolver.EnableNoDollarQueryOptions works fine so I close my issue
I am using Microsoft.AspNetCore.OData 7.0.0-Nightly201804111241 to play with
ODataUriResolver.EnableNoDollarQueryOptions
setting.If I register in DI ODataUriResolver with EnableNoDollarQueryOptions = true this not work - ODataQueryOptions parameter in controller don't understand '?top=1', understand only '?$top=1'.
I tried to investigate this and I found that in method ODataQueryOptions.Initialize() constructor for ODataQueryOptionParser not passed IServiceProvider argument (context.RequestContainer should be passed as last argument I think).
Because of this ODataQueryOptionParser.Configuration property became not DI-aware. And later in ODataQueryOptionParser.TryGetQueryOption method Configuration property used to get EnableNoDollarQueryOptions option value - and it always false.
So please use another constructor for ODataQueryOptionParser that has IServiceProvider argument.