Reputation: 8967
In the same solution, I have an MVC 4 Web Application project ("the site") and an MVC 4 Web API project ("the service").
In future, I may want to deploy the service on separate server from the site.
Therefore, I would like the site's model class to call the into the service's web methods.
Is this possible ? How can I accomplish this ?
Upvotes: 0
Views: 1466
Reputation: 9399
Unless I'm missing something, why don't you just create the site's model as a separate project in your solution. Your site would reference it. The model would make calls to your web API over HttpWebRequest or something similar.
Upvotes: 1