Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use extensions from a Non Asp.net Core context #22

Open
pietje666 opened this issue Feb 20, 2020 · 1 comment
Open

Use extensions from a Non Asp.net Core context #22

pietje666 opened this issue Feb 20, 2020 · 1 comment

Comments

@pietje666
Copy link

How should we use this package from a Non ASP.net Core context where the Ninject DI system is being used? Hence i can not use the provided AddODataClient() / AddHttpClient() functionality since it is build on IServiceprovider which is not available.

Binding the DefaultODataClientFactory manually is not possible neither since the class is marked as internal (and deriviates as well). I am also wondering how i could get it working.

@weitzhandler
Copy link

weitzhandler commented Mar 30, 2020

Usually there are bridges between the various IoC providers. Never used Ninject, but you should be able to find an adapter that gives you a Microsoft.Extensions.DependencyInjection.IServiceCollection and IServiceProvider respectively, wrapped around your Ninject service provider, that you can use with OData Extensions.

And BTW, Microsoft Extensions has vastly improved lately and provides all the plumbing around any of your .NET Core apps - not just ASP.NET, also console or WPF apps, and it also includes logging and bootstrapping, so if you're building a new project and don't have a special reason to use Ninject, you might consider giving it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants