从 Ria 服务返回子类实体
我有继承自 EntityBase 的 EntityImplements
任何人都知道如何从客户端获取 EntityImplements 的属性(如果重要的话,它们是复杂的属性)?
当我查询数据时,我返回了两种实体类型,但我无法获取 EntityImplements 特有的任何属性,
我认为这是一个元数据问题
,我尝试专门为实体2添加类和元数据(我可能搞砸了)(默认情况下它只为基本实体创建元数据)但无济于事。
我的下一步尝试是定义一个仅返回 EntityImplements 的查询,但这会导致许多其他问题。
请帮忙
I have EntityImplements which inherits from EntityBase
Anyone know how I can get to the properties (they are complex properties if that matters) of EntityImplements from the client side?
When I query the data I get back both entity types, but I cant get to any property that is unique to EntityImplements
I assume it is a metadata issue
I tried adding the class and metadata (which I may have bungled) specifically for the entity2 (default it only creates the metadata for the base entity) but to no avail.
My next step to try is to define a query that only returns EntityImplements but that causes lots of other issues.
Help Please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我想我解决了。
这就是我必须做的。
在域服务的元数据文件中
对于基类,解封子新的(或在 VB 中将其更改为友元)
使用子类的名称创建一个分部类(不会自动生成)
让您的分部类从基类继承
让 Metadata 类继承自 baseclass.baseclassmetadata
在子类的元数据部分,仅添加基类未实现的属性,并根据需要使用 include 等进行注释。
OK, I think I solved it.
Here is what I had to do.
In the metadata file of the domainservice
For the base class unseal the sub new (or change it to friend in VB)
Create a partial class with the name of the sub class (which does not get auto gened)
Have your partial class inherit from the base class
Have the Metadata class inherit from the baseclass.baseclassmetadata
In the metadata portion of your subclass, add only the properties that are not implimented by the base class, and annotate with include as needed, etc.