简体   繁体   中英

Sending abstract class with DomainService WCF service to Silverlight

I was using a simple WCF service with silverlight but I wanted to validate data with annotations and I didn't want to write a whole new layer in silverlight project. So I decided to switch to using a DomainService, created through generating code in the silverlight project.

Now comes the trouble. I have a parent class and about 10 derived classes. Through WCF, I was able to just use the base class. Now I am trying to use a DomainService with the base class decorated with the KnownType attribute. The problem is now those attributes get replicated in silverlight client and a compilation error is thrown. Anybody know how to use DomainService with inheritance? I want to deliver only the information from the base class.

我并没有完全理解您的问题所在,但这是一个很好的教程 ,说明如何在Silverlight中使用域服务,并且该示例包括所有实体的抽象基类,类似于我认为的做法。

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