I'm trying to register decorator for service these uses property injection.
When I'm adding containerBuilder.RegisterDecorator<ServiceDecorator, IService>() that properties are no longer injected.
I guess Autofac is trying to inject it to the decorator instead of original service.
I've written some tests to showcase this problem. There are services and the decorator:
public interface IService
{
bool NestedServiceIsNotNull();
}
public interface INestedService { }
public class Service : IService
{
public INestedService NestedService { get; set; }
public bool NestedServiceIsNotNull()
{ …Run Code Online (Sandbox Code Playgroud)