You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #1200, but this is definitely just a v6 issue that wasn't in v5.
If you have a decorated instance, with property injection, and circular dependencies allowed on said property injection, the properties won't be injected.
The instance used for property injection in that event is the decorator, rather than the instance.
This (new) test fails:
privateinterfaceIMyService{voidAssertProp();}privatesealedclassDecoratedService:IMyService{publicstringProp{get;set;}publicvoidAssertProp(){if(Prop isnull){thrownew NullReferenceException();}}}privatesealedclassServiceDecorator:IMyService{privatereadonlyIMyService_decorating;publicServiceDecorator(IMyServicedecorating){_decorating=decorating;}publicvoidAssertProp(){
_decorating.AssertProp();}}[Fact]publicvoid DecoratedInstanceWithPropertyInjectionAllowingCircularReferencesStillInjects(){
var val ="Value";
var builder =new ContainerBuilder();
builder.RegisterInstance(val);
builder.RegisterType<DecoratedService>().As<IMyService>().PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);
builder.RegisterDecorator<ServiceDecorator,IMyService>();varcontainer= builder.Build();varinstance= container.Resolve<IMyService>();
instance.AssertProp();}
Luckily, unlike #1200, this one should be an easy fix. I just need to ensure I capture the new instance and pass that into the event handler.
The text was updated successfully, but these errors were encountered:
Related to #1200, but this is definitely just a v6 issue that wasn't in v5.
If you have a decorated instance, with property injection, and circular dependencies allowed on said property injection, the properties won't be injected.
The instance used for property injection in that event is the decorator, rather than the instance.
This (new) test fails:
Luckily, unlike #1200, this one should be an easy fix. I just need to ensure I capture the new instance and pass that into the event handler.
The text was updated successfully, but these errors were encountered: