Skip to content

Instantly share code, notes, and snippets.

@smiler
Created February 22, 2012 07:56
Show Gist options
  • Save smiler/1883330 to your computer and use it in GitHub Desktop.
Save smiler/1883330 to your computer and use it in GitHub Desktop.
container.Register(Classes.FromAssemblyContaining(typeof(IRepository))
.BasedOn<IRepository>()
.If(Component.IsInSameNamespaceAs<BaseEntityRepository<BaseEntity>>())
.If(t => t.Name.EndsWith("Repository") && (t.Name.StartsWith("Foo") || t.Name.StartsWith("Bar")))
.Configure(c => c.DependsOn(ServiceOverride.ForKey("Session").Eq("db.session.second"))
.DependsOn(ServiceOverride.ForKey("SessionFactory").Eq("db.sessionfactory.second"))).LifestylePerThread());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment