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?

有帮助吗?

解决方案

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.

其他提示

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;

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top