public static IIocRegistrator RegisterManyTransient( this IIocRegistrator registrator, Type implementationType, bool autoInjectProperty = false) { return(registrator.RegisterMany( implementationType, autoInjectProperty, DependencyLifeTime.Transient)); }
public static IIocRegistrator RegisterManySingleton( this IIocRegistrator registrator, IEnumerable <Type> implementationTypes, bool autoInjectProperty = false) { return(registrator.RegisterMany( implementationTypes, autoInjectProperty, DependencyLifeTime.Singleton)); }
internal static IIocRegistrator RegisterMany( this IIocRegistrator registrator, Type implementationType, bool autoInjectProperty = false, DependencyLifeTime lifeTime = DependencyLifeTime.Transient) { registrator.RegisterMany( new[] { implementationType }, autoInjectProperty, lifeTime); return(registrator); }
public static IIocRegistrator RegisterManyScoped( this IIocRegistrator registrator, IEnumerable <Type> seviceTypes, Type implementationType, bool autoInjectProperty = false) { registrator.RegisterMany(seviceTypes, implementationType, autoInjectProperty, DependencyLifeTime.Scoped); return(registrator); }
internal static IIocRegistrator RegisterAssemblies( this IIocRegistrator registrator, IEnumerable <Assembly> assemblies, Func <Type, bool> typeSelector, bool autoInjectProperty, DependencyLifeTime lifeTime) { Check.NotNull(registrator, nameof(registrator)); assemblies = assemblies ?? AppDomain.CurrentDomain.GetAssemblies(); var types = assemblies .SelectMany(asm => asm.DefinedTypes) .Select(typeInfo => typeInfo.AsType()) .Where(type => typeSelector?.Invoke(type) ?? true); foreach (var type in types) { registrator.RegisterMany(type, autoInjectProperty, lifeTime); } return(registrator); }
public static IIocRegistrator RegisterManySingleton <TImplementation>( this IIocRegistrator registrator, bool autoInjectProperty = false) { return(registrator.RegisterMany <TImplementation>( autoInjectProperty, DependencyLifeTime.Singleton)); }