Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Solved: RESTful WCF implementation through MEF

Back to Forum: Tech Off
  • User profile image

    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:

  • User profile image

    I was missing the WCF Web API (Preview 4) It was surprisingly hard to find!

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.