Skip to content

Instantly share code, notes, and snippets.

@explorer14
Created May 27, 2018 20:22
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 explorer14/23f1e5b758878bf6165b182fa6623096 to your computer and use it in GitHub Desktop.
Save explorer14/23f1e5b758878bf6165b182fa6623096 to your computer and use it in GitHub Desktop.
internal class MyActivator : IJobActivator
{
private readonly IServiceProvider serviceProvider;
public MyActivator(IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
}
public T CreateInstance<T>()
{
return this.serviceProvider.GetService<T>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment