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

Dependency Injection built in to Azure Functions #37

Open
justinkneff opened this issue May 8, 2019 · 2 comments
Open

Dependency Injection built in to Azure Functions #37

justinkneff opened this issue May 8, 2019 · 2 comments

Comments

@justinkneff
Copy link

Microsoft released Dependency Injection functionality recently which is built on top of the ASP.NET Core Dependency Injection Features. What advantages and disadvantages does providing this solution using Attributes provide their functionality does not?

Is one or the other better performing? Is this faster cold boot? Is there functionality missing/provided by the other? What does compatibility look like with different IoC Containers, or package dependencies?

http://aka.ms/functions-di-docs

@juliusl
Copy link

juliusl commented May 8, 2019

One thing I've noticed is that this package has an [Inject] attribute which let's you inject the dependency directly into the parameter of the function.

The official DI implementation you have to inject it into a constructor which means that you can't have a static class/function.

Unless I'm missing something, but from that link there wasn't any usage examples so I'm going by: https://github.com/Azure/azure-functions-dotnet-extensions/tree/master/src/samples/DependencyInjection

@rasmuschristensen
Copy link

I just blogged about how to do setup and consume with the new bits and pieces
https://blog.rasmustc.com/azure-functions-dependency-injection/

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

3 participants