I've been spending the last 3 hours reading 30 unique examples of combining the new WebHttp API in .NET 4 (a.k.a REST) with MEF (yet another IoC framework).
(Global.asax.cs) var configuration = HttpHostConfiguration.Create() .SetResourceFactory(new MyCustomResourceFactory(container)); RouteTable.Routes.MapServiceRoute<ContactsResource>("contacts", configuration);
This example does exactly what I want. But HttpHostConfiguration and the MapServiceRoute both seem to be deprecated (Probably a part of the old starter kit). I cant use the normal ServiceRoute because that requires a class, but all I got is a interface since they are loosely coupled.
I have also tried implementing the IInstanceProvider but to no avail.
This is my last resort, google is refusing to help me. :argh: