开发者

Castle Windsor 2.5 Breaking Changes

开发者 https://www.devze.com 2023-01-14 18:04 出处:网络
I have code that was previously adding ExtendedProperties to components like component.ExtendedProperties( new { prop = someObject });

I have code that was previously adding ExtendedProperties to components like

component.ExtendedProperties( new { prop = someObject });

This method is no longer available and the constructor for Property is marked internal.

Is there a new way of doing this for v2.5?

Specifically, I have a custom ComponentActivator that needs some instance information at resolution time from the initial registration. I have been storing this information in the ExtendedProperties then retrieving it in the ComponentActivator constructor u开发者_如何学Gosing

model.ExtendedProperties["prop"] as MyObjectType;


This was never changed in .NET version, so I'm assuming you're talking about version for Silverlight.

This method will be back in version 2.5.1, however due to restrictive behavior of Silverlight runtime you will have to make internal types in your assembly visible to Castle.Core.

Alternative way, that works across all versions is this:

component.ExtendedProperties( Property.ForKey("prop").Eq(someObject));
0

精彩评论

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