Skip to content

Instantly share code, notes, and snippets.

@geoffreysmith
Created May 15, 2011 00:57
Show Gist options
  • Save geoffreysmith/972788 to your computer and use it in GitHub Desktop.
Save geoffreysmith/972788 to your computer and use it in GitHub Desktop.
Query dependency injection
private static void AddApplicationServicesTo(IWindsorContainer container)
{
container.Register(
AllTypes
.FromAssemblyNamed("SharpArchCookbook.Tasks")
.Pick()
.WithService.FirstInterface());
}
private static void AddQueriesTo(IWindsorContainer container)
{
//Query objects
container.Register(
AllTypes.FromAssemblyNamed("SharpArchCookbook.Web.Mvc")
.Pick()
.WithService.FirstInterface());
//IQuery<T>
container.Register(
AllTypes.FromAssemblyNamed("SharpArchCookbook.Tasks")
.Pick()
.WithService.FirstNonGenericCoreInterface("SharpArchCookbook.Infrastructure"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment