开发者

Add custom property with RIA Service on client side

开发者 https://www.devze.com 2023-03-20 21:02 出处:网络
I need to add a custom attribute on client side with WCF RIA Service. This property isn\'t in my Model (.edmx) but is an implementation of my interface.

I need to add a custom attribute on client side with WCF RIA Service. This property isn't in my Model (.edmx) but is an implementation of my interface.

The property to add:

public IEmployee MyEmployee
{
   get { }
}

I try this:

[DataMemberAttribute]
public IEmployee MyEmployee开发者_运维问答
{
   get { }
}

but this doesn't work.

A basic return type works:

[DataMemberAttribute]
public string MyEmployeeId
{
   get { }
}

(I think) it's because I return an IEmployee and I need to implement this property.

I can't rename the file to *.shared.cs due to his dependencies.

Is it possible to do this ?


If for some reasone you just need the property on the client, keep in mind that entities created on the client-side are partial classes, so I guess you could extend them and add the properties you need.
Hope it helps.

0

精彩评论

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