tag:blogger.com,1999:blog-1688176320920284646.post1568711835088852848..comments2023-12-20T10:24:23.540+00:00Comments on A day in the life of...: Decorating Unity extensionUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1688176320920284646.post-36176493548381072982016-01-22T01:56:26.409+00:002016-01-22T01:56:26.409+00:00There's something weird going on in my Unity r...There's something weird going on in my Unity registrations that result in my decorators being doubled up (so in your example, I get a CommandLogger decorating a CommandLogger decorating a Command). <br /><br />I am ending up with two DecoratorBuildStrategies in the IBuilderContext passed in to the PostBuildUp - I think the Context_ChildContainerCreated call is adding the DecoratorBuildStrategy to the parent and not to the child container. Does that sound right?David Keavenyhttps://www.blogger.com/profile/07944978161341604262noreply@blogger.comtag:blogger.com,1999:blog-1688176320920284646.post-91643126454915310132014-07-07T02:01:01.593+01:002014-07-07T02:01:01.593+01:00Hi Peter,
I found your version after stumbling on...Hi Peter,<br /><br />I found your version after stumbling on Beefy's.<br /><br />This is really good work.<br /><br />I wanted to let you know I made a few minor "improvements": ;-}<br /><br />1. Respect ordering of multiple Decorators for the same type combination, mimicking the last-in/first-executed semantic used by Simple Injector.<br />2. I also added a C# extension class that permits a RegisterDecorator() call directly from the container which will then add your Unity extension (if not already registered) and then just forward the request onward. (My rationale for adding this is that this also exactly mimics Simple Injector.)<br /><br />I'm happy to send this version to you if you'd like, you can email me, dev at zenzagal dot com.<br /><br />Thanks.Anonymoushttps://www.blogger.com/profile/05567835415539044845noreply@blogger.com