views:

473

answers:

0

When defining bindings for types that requires ctor arguments for the default instance it's pretty clear how to do it. However, when I want to create alternative profiles it gets a bit more difficult.

This is how it's done for a default instance:

ForRequestedType(typeof (IRepository<>))
    .TheDefaultIsConcreteType(typeof (SpRepository<>))
    .CtorDependency<Uri>("sourceWeb")
    .Is(new Uri("http://localhost"));

This is where I'm stuck with a profile:

CreateProfile("wss")
    .For(typeof(IRepository<>))
    .UseConcreteType(typeof(SpRepository<>))
    // I'd expect to be able to insert this here...
    //.CtorDependency<Uri>("sourceWeb")
    .Is(new Uri("http://localhost")))

How can I set up the typemapping for this profile?

Am I forced to use instance binding (where I can pass default values to the ctor arguments)?