在动态代理中保留基类属性

发布于 2024-07-25 20:10:07 字数 313 浏览 4 评论 0原文

我正在使用 Castle DynamicProxy2。 是否可以告诉代理对象继承其基类(代理类)上的属性和基类属性上的属性。 如果在城堡里不可能的话。 还有其他用于此目的的库吗?

我在这里发布了问题来源 使用动态代理和 wcf 的通用 IPropertyChangedNotifier序列化问题

I am using Castle DynamicProxy2.
Is it possible to tell proxy object to inherit attributes on its Base Class(proxied class) and attributes on Properities of Base class.
If not possible in Castle. Any other library for this purpose??

I have posted source of problem here Generic IPropertyChangedNotifier using Dynamic Proxy and wcf serialization problem

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾`听者〃 2024-08-01 20:10:07

您可能需要考虑这些类可能不适合在代理类中使用。

对于实体框架或 LINQ to SQL 类也是如此 - 这些类序列化来自基类的数据,使它们特定于平台。

您可能应该创建与您的 Castle 类型相对应的数据传输对象,然后将数据复制到其中或从中复制出来,并来回传递 DTO 实例。

You may want to consider that these classes may not be appropriate for use in proxy classes.

This is also true for Entity Framework or LINQ to SQL classes - these serialize data from the base classes, making them platform-specific.

It's possible that you should create Data Transfer Objects corresponding to your Castle types, and then copy data into or out of them, and pass the DTO instances back and forth.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文