Reputation: 10332
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.
Upvotes: 1
Views: 612
Reputation: 57783
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))
Upvotes: 3