How can I modify edmx and reflect changes in the domainservice automatically?
-
14-03-2021 - |
Question
I have a silverlight business application created with vs2010 and it is RIA service enabled, I added new table in the database and updated the edmx using (update model from database option), but I want to update the domain service class as well to include the new tables, how can I do that?
Solution
I haven't found a way to do this automatically, but this blog seems helpful. EDIT: If you use partial classes as suggested, then you can delete the DomainService1.cs class and use add new item to add the class again. Then using the built in wizard, re-check the entities you want to expose. The partial classes will hold your custom logic.
OTHER TIPS
Unfortunately I have not found nothing better than:
- Add new DomainService that will work with new table;
- Copy generated code into existing(main) service (Get*, Insert, Update, Delete etc.);
- Copy metadata;
- Delete "new" DomainService and "new" metadata files;
After these steps you'll get access to your table.
NOTE:
*-without Get- method client will not recognize any changes;