Created
April 15, 2019 01:11
-
-
Save adlerpagliarini/d8f1793d8d72e70df6db34d6e6be39cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Startup | |
{ | |
... | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
... | |
app.UseMvc(routerBuilder => | |
{ | |
// 2. Enable Dependency Injection on current routes | |
routerBuilder.EnableDependencyInjection(builder => | |
{ | |
builder | |
.AddService(Microsoft.OData.ServiceLifetime.Singleton, typeof(ODataUriResolver), sp => new StringAsEnumResolver()) | |
.AddService(Microsoft.OData.ServiceLifetime.Singleton, typeof(ODataUriResolver), sp => new UnqualifiedCallAndEnumPrefixFreeResolver { EnableCaseInsensitive = true }); | |
}); | |
... | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment