Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Created February 1, 2020 07:19
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/d901587a375097bcf90b0f1596e48511 to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/d901587a375097bcf90b0f1596e48511 to your computer and use it in GitHub Desktop.
Dispose services in the service container
private static void DisposeServices()
{
if (_serviceProvider == null)
{
return;
}
if (_serviceProvider is IDisposable)
{
((IDisposable)_serviceProvider).Dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment