Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Created February 1, 2020 01:45
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 PradeepLoganathan/b6d9a430ee8218318cc6f2311234d871 to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/b6d9a430ee8218318cc6f2311234d871 to your computer and use it in GitHub Desktop.
Registering Services in the DI container
private static void RegisterServices()
{
var services = new ServiceCollection();
services.AddSingleton<ICustomer, Customer>();
services.AddSingleton<ConsoleApplication>();
_serviceProvider = services.BuildServiceProvider(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment