简体   繁体   中英

Silverlight project seperated from WCF-service - How to acces database types

I have two solutions: 1 for my Silverlight app and 1 for my WCF service. Currently I have access to my entity types via a ADO.NET Self-Tracking Entity I created (it gives me a .tt file with all entities) but it fails every time I edit something in the database and I need to spend hours to fix it.

So here is what I think I need (please suggest something better if that exists): - I should switch to NHibernate and bind my data in an .xml file. - I should be able to access my entity types from my SilverLight solution with a shared .xml file between the two solutions.

One of my coworkers suggested that I use the ADO.NET DbContext Generator but as far as I know it still generate these horrible .tt files which fails for me.

What to do? Use NHibernate, DbContext Generator or something else?

We use Entity Framework Code First on the server - no changes directly in the database, all the change is driven by the source files.

We use DTO's (defined on the server) to carry data between the WCF service and the Silverlight client. Creating a Service Reference generates client-side equivalents of the DTO classes. We use EmitMapper to automatically map entities to and from the DTO's on the server and on the client.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM