开发者

Breaking up a WCF RIA Services Project

I'm currently building an application that has two parts, the user front end and the administration backend. The front end is a ASP.NET MVC application and the backend is a silverlight application. I started the project by creating a silverlight business application called Administration and two projects got added, the silverlight app (Administration) and the hosting web-app (Adm开发者_运维百科inistration.Web). I want to use RIA services with the silverlight application, so I added an Entity data model and built the service.

The problem I'm having is that I'd like to add an ASP.NET MVC project and reference a project that contains the data model. I'd prefer that the data model exist in its own project, instead of one so the admin and frontend can reference a class library, instead of a asp.net web application.

Is it possible to move the .edmx file to another project (class library) and continue to get RIA services to work?


This may be possible. First add your Entity Model to a class library project and add your tables. Then create a Web Application and have it reference your class library. In your Web project add a domain service and in the wizard select your Entity Model (make sure to build your class library project otherwise the model might not appear). Then create a Silverlight application and for the RIA Services link select your Web application. You can then create the ASP.NET MVC web application and have that reference your class library. When it comes to Silverlight you won't be able to access the Domain Model directly so this will still have to be done through a Domain Service.

I've not at a machine to verify this (it's just from memory), so please let me know if any of this is wrong. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜