Skip to content

Commit 15461a0

Browse files
# Conflicts: # README.md
2 parents bc0177c + 915fa85 commit 15461a0

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Autofac On Functions
2-
Azure Function Autofac Integration
2+
Azure Function Autofac Integration, now version 1 available in nuget!
33

44
For a comprehensive explanation have a look at
55

66
- [codingsoul: azure functions dependency injection with autofac](http://codingsoul.de/2018/01/19/azure-function-dependency-injection-with-autofac/)
77
- [codingsoul: azure functions dependency injection with autofac nuget package](http://codingsoul.de/2018/06/12/azure-functions-dependency-injection-autofac-on-functions-nuget-package/)
8+
- [codingsoul: named services, fixes for breaking changes](http://codingsoul.de/2018/09/11/autofaconfunctions-named-services-support-fixes-for-breaking-changes/)
9+
- [codingsoul: autofaconfunctions version 1 released](http://codingsoul.de/2018/09/24/autofaconfunctions-version-1-released/)
810

9-
Actually the current library and the nuget package only work on .net core. .net Framework support for Azure Functions version since 1.0.19 will follow.
11+
# Environment
12+
Current library supports net framework and net standard since Microsoft.Net.Sdk.Functions version 1.0.21. For that version Azure Functions V2 is necessary. If you want to work with former version of the sdk, have a look onto the [archive](https://github.com/holgerleichsenring/AutofacOnFunctions/tree/master/archive/).
1013

11-
In sources there are two samples available that you can just use, when you don't want to use the nuget package or you want to work with the old V1 version of Azure Functions:
12-
- Azure Functions V1 with .net framework.
13-
- Azure Functions V2 with dot net standard.
14-
15-
It doesn't matter which sample, the procedure how to use dependency injection is identical.
14+
# Paradigm
15+
It doesn't matter with version of dotnet is going to be used, dependency injection paradigm is done completely identical. The code probably need some different references for implementing the function itself due to microsoft.net.sdk.functions implementation in certain versions.
1616

1717
# Goal
1818
Azure functions are by design static. Allow for dependency injection within Azure function with Autofac. The extensible nature of Azure Functions allow for attribute based dependency injection implementation. The attribute is called "Inject". Just add it as a parameter to your function combined with the type and name of the service parameter.
@@ -63,8 +63,13 @@ The bootstrapper implementations will be read and autofac will be configured whe
6363

6464
# Breaking Changes
6565

66+
## Microsoft.net.sdk.function version 1.0.19
6667
As version 1.0.19 of Azure Functions made changes to the procedure of initialization necessary, the former used ServiceLocator is not available anymore. Anyway you should not use a direct reference to an Autofac IContainer reference anyway. If you need to resolve services on the fly, just inject IObjectResolver to your class.
6768

69+
## Microsoft.net.sdk.function version 1.0.21
70+
Version 1.0.19 references WebJobs Azure Functions made changes to the procedure of initialization necessary, the former used ServiceLocator is not available anymore. Anyway you should not use a direct reference to an Autofac IContainer reference anyway. If you need to resolve services on the fly, just inject IObjectResolver to your class.
71+
72+
6873
# Named Services
6974
Autofac allows for named services. AutofacOnFunctions had been enhanced to support named services in most initutive way. Actually there are only two steps to do.
7075

@@ -98,7 +103,8 @@ public static class Function2
98103
}
99104
```
100105

101-
Full sample is available
102-
[AutofacOnFunctions net framework sample](https://github.com/holgerleichsenring/AutofacOnFunctions/tree/master/AutofacOnFunctions/AutofacOnFunctions.Samples.NetFramework)
103-
[AutofacOnFunctions net standard sample](https://github.com/holgerleichsenring/AutofacOnFunctions/tree/master/AutofacOnFunctions/AutofacOnFunctions.Samples.NetStandard)
106+
Full sample is available
107+
108+
- [net standard](https://github.com/holgerleichsenring/AutofacOnFunctions/tree/master/AutofacOnFunctions/AutofacOnFunctions.Samples.NetStandard)
109+
- [net framework](https://github.com/holgerleichsenring/AutofacOnFunctions/tree/master/AutofacOnFunctions/AutofacOnFunctions.Samples.NetFramework)
104110

0 commit comments

Comments
 (0)