I want to create an application that has both an ASP.NET MVC 3 web client and a Windows Phone 7 phone client. The application data is stored in SQL Server and needs to be accessed from both clients.
Given that scenario, I have two questions:
FluentValidation
. Am I supposed to create a new class library called ViewModels and reference it in both client projects, or is there a better way?How would an appropriate solution structure for that scenario look like?
Am I supposed to create a new class library called ViewModels and reference it in both client projects, or is there a better way?
Yes. Except you can't. Or well, you can, but you need two different project types for this. I'll recommend using shortcuts in one of the projects.
a "Windows Phone Class Library" isn't accessable from ASP.NET, and visa-versa.
Would it be appropriate to create a Web Service that both clients talk to?
Yes, very appropriate
Or is it better to access the data via the MVC web project?
You could host the web-service in your web-project. But a seperate service is easier to maintain, if you have the ability to host it.
With RestSharp you could easily integrate it with ASP.NET MVC.