Using ContactManager sample as an example - there should be a way to have a container build the ContactsResource, injecting IContactRepository instead of having it explicitly instantiated in default constructor as it is now. The framework should then resolve ContactsResource against the container. I imagine that instead of using concrete ContactsResource implementation this could be also done for interfaces (assuming we would register and interface in Global.asax.cs : RouteTable.Routes.AddServiceRoute<IContactsResource>("contacts", configuration);).
public class ContactsResource
private readonly IContactRepository repository;
public ContactsResource(IContactRepository repository)
this.repository = repository;
: this(new ContactRepository())