tags:

views:

30

answers:

1

I'd like to identify some types using a service name.

I need exactly what is showen in this example

builder.RegisterAssemblyTypes(controllers)
.Where(t => t.IsAssignableTo(typeof(IController))
.Named(t => "controller-" + t.Name.ToLower());

But the method named has no overload which takes one argument of type string(only the generic one does). The method takes a second argument of type type.

+3  A: 

I think this is a mistake in the documentation and you should use either

Named<IController>(t => "controller-" + t.Name.ToLower())

or

Named(t => "controller-" + t.Name.ToLower(), typeof(IController))
adrift