I am using ASP .NET MVC2 to create a data driven web site. Part of the feature request is also to create reusable web services to expose some of the data and business logic using which end users can create mashups. There will be a significant amount of users using it within and outside our organization.
So far I have built the application that communicates to the database (using the entity framework ORM), processes and displays the data (using the model view view model pattern). This part has been straightforward for the website part.
As for the webservices part, I am looking into using WCF to create the web services. Should I create WCF data services as a separate project. I am guessing I should be able to reuse some of the code in the controller.
In the website part should I call these web services and use them as the model? Any best practices?
As somoeone new to asp .net, any pointers towards the right direction would be greatly appreciated.
JsonResultas the view output?JsonResultwhen you can directly access the SQL server from within the controller? I think the question here is to expose a reusable service which could be consumed by various clients.