public static IStartupConfigurationWrapper FindImplementor(this IStartupConfigurationWrapper manager) { Type registerType = _builder.TypeToGuid.Keys.LastOrDefault(); Type implementorType = registerType.Assembly.GetTypes().FirstOrDefault(x => x.GetInterfaces().Any(y => y == registerType)); if (implementorType == null) { throw new NullReferenceException(); } _registerManager.AddTypeImplementor(implementorType); return(manager); }
public static IStartupConfigurationWrapper PerThread(this IStartupConfigurationWrapper manager) { _registerManager.AddLifeStyle(LyfeStyle.PerThread); return(manager); }
public static IStartupConfigurationWrapper SingleInstance(this IStartupConfigurationWrapper manager) { _registerManager.AddLifeStyle(LyfeStyle.SingleInstance); return(manager); }
public static IStartupConfigurationWrapper WithConstructorArguments(this IStartupConfigurationWrapper manager, string paramenterName, object value) { _configProperties.CtorParams.Add(paramenterName, value); return(manager); }
public static IStartupConfigurationWrapper As(this IStartupConfigurationWrapper manager, Func <object, object> objectImplementor) { _configProperties.ExistingObject = objectImplementor?.Invoke(objectImplementor); return(manager); }
public static IStartupConfigurationWrapper As <TImplementor>(this IStartupConfigurationWrapper manager) { _registerManager.AddTypeImplementor(typeof(TImplementor)); return(manager); }