Skip to content

Instantly share code, notes, and snippets.

@tonysneed
Created December 16, 2018 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonysneed/2106a541cfe6a8819f7db515dbf68017 to your computer and use it in GitHub Desktop.
Save tonysneed/2106a541cfe6a8819f7db515dbf68017 to your computer and use it in GitHub Desktop.
Function Ctor 2
// Configuration Service
public IConfigurationService ConfigService { get; }
public Function()
{
// Set up Dependency Injection
var serviceCollection = new ServiceCollection();
ConfigureServices(serviceCollection);
var serviceProvider = serviceCollection.BuildServiceProvider();
// Get Configuration Service from DI system
ConfigService = serviceProvider.GetService<IConfigurationService>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment