开发者

Returning subclassed entities from Ria Services

开发者 https://www.devze.com 2023-02-11 17:49 出处:网络
I have EntityImplements which inherits from EntityBase Anyone know how I can get to the p开发者_开发百科roperties (they are complex properties if that matters) of EntityImplements from the client sid

I have EntityImplements which inherits from EntityBase

Anyone know how I can get to the p开发者_开发百科roperties (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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消