Beispiel #1
0
 public void Process(Type type, StructureMap.Registry registry)
 {
     if (type.CanBeCastTo <Controller>() && !type.IsAbstract)
     {
         registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
     }
 }
Beispiel #2
0
        public void ScanTypes(TypeSet types, StructureMap.Registry registry)
        {
            var nonPublicClasses = typeof(TLocator).Assembly.GetTypes().Where(WithCustomAttribute);

            foreach (var nonPublicClass in nonPublicClasses)
            {
                foreach (var @interface in nonPublicClass.GetInterfaces())
                {
                    registry.For(@interface).Use(nonPublicClass);
                }
            }
        }