开发者

Overridding GetHashCode and Equals in Castle Dynamic Proxy 2.1 IModelInterceptorsSelector

开发者 https://www.devze.com 2023-01-05 15:17 出处:网络
I\'ve read that in order to get caching and push performance when using an Interceptor Selector when using Castle Dynamic Proxy that I need to override GetTy开发者_JAVA百科pe(), GetHashCode() and Equa

I've read that in order to get caching and push performance when using an Interceptor Selector when using Castle Dynamic Proxy that I need to override GetTy开发者_JAVA百科pe(), GetHashCode() and Equals()

Where can I find an example of or what would be the best, from a performing perspective, implementation?


you can't override GetType, it's not virtual.

For the remaining ones, use the same technique you'd use for any other type. I generally make my selectors stateless, and implement the methods as this.GetType().GetHashCode() and This.GetType() == other.GetType()

0

精彩评论

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