-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Description
Describe the bug
When two collections are registered conditionally, it triggers a Torn Lifestyle validation, while the configuration is valid.
To Reproduce
var container = new Container();
var reg1 = container.Collection.CreateRegistration<ILogger>(typeof(NullLogger));
var reg2 = container.Collection.CreateRegistration<ILogger>(typeof(ConsoleLogger));
container.RegisterConditional(
serviceType: typeof(IEnumerable<ILogger>),
registration: reg1,
c => c.Consumer?.ImplementationType == typeof(Consumer1));
container.RegisterConditional(
serviceType: typeof(IEnumerable<ILogger>),
registration: reg2,
c => c.Consumer?.ImplementationType != typeof(Consumer1));
container.Verify();Additional context
Latest release v5.5.0