Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static IStartupConfigurationWrapper PerThread(this IStartupConfigurationWrapper manager)
 {
     _registerManager.AddLifeStyle(LyfeStyle.PerThread);
     return(manager);
 }
Exemplo n.º 3
0
 public static IStartupConfigurationWrapper SingleInstance(this IStartupConfigurationWrapper manager)
 {
     _registerManager.AddLifeStyle(LyfeStyle.SingleInstance);
     return(manager);
 }
Exemplo n.º 4
0
 public static IStartupConfigurationWrapper WithConstructorArguments(this IStartupConfigurationWrapper manager, string paramenterName, object value)
 {
     _configProperties.CtorParams.Add(paramenterName, value);
     return(manager);
 }
Exemplo n.º 5
0
 public static IStartupConfigurationWrapper As(this IStartupConfigurationWrapper manager, Func <object, object> objectImplementor)
 {
     _configProperties.ExistingObject = objectImplementor?.Invoke(objectImplementor);
     return(manager);
 }
Exemplo n.º 6
0
 public static IStartupConfigurationWrapper As <TImplementor>(this IStartupConfigurationWrapper manager)
 {
     _registerManager.AddTypeImplementor(typeof(TImplementor));
     return(manager);
 }