在客户端上扩展 WCF Ria 服务中的计算属性
我有一个来自 WCF 服务的业务对象。我知道我可以通过 创建来扩展该业务对象客户端上的部分类。但是,是否可以扩展来自生成的业务对象的属性。例如,假设业务对象有一个名为 Name 的属性。我想要做的是,在客户端,用 [DisplayAttribute] 标记此属性。
任何帮助将不胜感激。
I have a business object that comes from a WCF service. I know that I can extend that business object by creating a partial class on the client. However, is it possible to extend a property that comes from the generated business object. For example, let's say that the business object has a property called Name. What I want to do is, on the client, to mark this property with the [DisplayAttribute].
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从未将其用于属性,但当在服务器上编译时,我经常使用预编译器语句来隐藏 Silverlight/客户端代码。例如,通常这样做是为了在服务器端和客户端上获取 EntityState:
SILVERLIGHT 在客户端上定义,但不在服务器端项目上定义(条件编译符号 - 项目属性,构建选项卡)。
我还没有尝试过,但我想这可能适用于属性?
Never used it for attributes, but I often use the pre-compiler statements to hide Silverlight/Client side code, when it compiles on the server. For Example, this is often done to get to EntityState on both the server and client side:
SILVERLIGHT is defined on the client side, but not on the Server side projects (conditional compilation symbol - project properties, Build tab).
I haven't tried it, but I'm thinking this might work with attributes?