Skip to content

Instantly share code, notes, and snippets.

@ronnieoverby
Created June 3, 2015 14:05
Show Gist options
  • Save ronnieoverby/364e2af40eeb2cf5cca7 to your computer and use it in GitHub Desktop.
Save ronnieoverby/364e2af40eeb2cf5cca7 to your computer and use it in GitHub Desktop.
public static class LightInjectExtensions
{
public static void RegisterFunc<T>(this IServiceRegistry reg, Func<IServiceFactory, T> factoryFunc)
{
if (reg == null) throw new ArgumentNullException("reg");
reg.Register(sf => factoryFunc(sf));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment