views:

13

answers:

1

I have used WCF in the past with my Webforms so my solution was

MyWebformApp = WCF(Model+business) + Web Forms

So when I want to work with the MVC for presentation arch. How do u use WCF with ASP.net MVC ? Are your data contracts a part of the model ? How do you register the datacontracts as properties?

+1  A: 

Roughly here are a few steps:

  1. Create a proxy of the service using svcutil.exe and include it in your application
  2. Create an interface which will abstract all the necessary methods you need to call from the application (IRepository)
  3. Implement this repository and call your WCF service (work with the generated client)
  4. Inject the repository into the controller constructor
  5. In the meantime think about the view models you would set and the mapping between the objects coming from the web service and those view models.
Darin Dimitrov