Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dependency Injections on Azure Functions V2
public class ContainerBuilder : IContainerBuilder
{
private readonly IServiceCollection _services;
public ContainerBuilder()
{
this._services = new ServiceCollection();
}
public IContainerBuilder RegisterModule(IModule module = null)
{
if (module == null)
{
module = new Module();
}
module.Load(this._services);
return this;
}
public IServiceProvider Build()
{
var provider = this._services.BuildServiceProvider();
return provider;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.