Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I exclude a type externally from a registry scan that found it?
  2. ObjectFactory.Configure(x =>
  3. {
  4.     x.AddRegistry<DefaultConventionsRegistry>();
  5.     x.Scan(scanner => scanner.ExcludeType<RunBanks>());
  6. });
  7.        
  8. public class DefaultConventionsRegistry : Registry
  9. {
  10.     public DefaultConventionsRegistry()
  11.     {
  12.         Scan(scanner =>
  13.         {
  14.             scanner.Assembly(AssemblyNames.WebAssemblyName);
  15.             scanner.WithDefaultConventions();
  16.             scanner.AddAllTypesOf<IHandles>();
  17.         });
  18.     }
  19. }
  20.        
  21. ObjectFactory.GetAllInstances<IHandles>();