Have just updated to version 6 of the library and have identified that the config.EnableCaseInsensitive(true) option has disappeared.
I've already seen issue #812 with a resolution using MapODataServiceRoute, however I'm actually just using the [EnableQuery] attribute within an ordinary Web Api (i.e. the controller inherits from ApiController and returns an IQueryable).
How can this type of query be made case insensitive in the new version?
Answering my own question - figured it out!
When enabling dependency injection, include an action. Then use the builder to add your own instance of a ODataUriResolver using dependency injection:
``` c#
config.EnableDependencyInjection(builder =>
{
builder.AddService
});
The custom resolver looks like this:
``` c#
public class CaseInsensitiveResolver : ODataUriResolver
{
public override bool EnableCaseInsensitive
{
get { return true; }
set { /* Ignore value */ }
}
}
Most helpful comment
Answering my own question - figured it out!
When enabling dependency injection, include an action. Then use the builder to add your own instance of a ODataUriResolver using dependency injection:
``` c#(ServiceLifetime.Singleton, sp => new CaseInsensitiveResolver());
config.EnableDependencyInjection(builder =>
{
builder.AddService
});