private static void RegisterSinglesAs(IReflection reflection, ContainerBuilder builder) { var injectablesAsEnumerable = reflection.AssignableTypes<Common.Modules.IInjectableAsEnumerable>(); foreach (var injectable in injectablesAsEnumerable) { builder.RegisterType(injectable).As(reflection.GetBaseType(injectable)).SingleInstance(); } }
private static void RegisterSingles<T>(IReflection reflection, ContainerBuilder builder) { var objTypes = reflection.AssignableTypes<T>(); foreach (var objType in objTypes) { builder.RegisterType(objType).AsSelf().InstancePerDependency(); } }