We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the following definitions:
interface IHandler<T> { } class IntHandler : IHandler<int> { } class Decorator<T> : IHandler<T> { public Decorator(IHandler<T> decoratee) { } }
The following code throws an 'lifestyle mismatch' exception:
var container = new Container(); container.Register(typeof(IHandler<int>), typeof(IntHandler), Lifestyle.Transient); container.RegisterDecorator(typeof(IHandler<>), typeof(Decorator<>), Lifestyle.Singleton); container.Verify();
And so does this code:
var container = new Container(); container.Register(typeof(IHandler<int>), typeof(IntHandler), Lifestyle.Transient); container.RegisterDecorator(typeof(IHandler<>), typeof(Decorator<>), Lifestyle.Singleton); container.RegisterDecorator(typeof(IHandler<>), typeof(Decorator<>), Lifestyle.Singleton); container.Verify();
But the following code does not throw an exception:
var container = new Container(); container.Register(typeof(IHandler<int>), typeof(IntHandler), Lifestyle.Transient); container.RegisterDecorator(typeof(IHandler<>), typeof(Decorator<>), Lifestyle.Singleton); container.RegisterDecorator(typeof(IHandler<>), typeof(Decorator<>), Lifestyle.Singleton); container.RegisterDecorator(typeof(IHandler<>), typeof(Decorator<>), Lifestyle.Singleton); container.Verify();
When more than two decorators are wrapped around a type, everything deeper than the second decorator doesn't get validated anymore.
The text was updated successfully, but these errors were encountered:
51c155e
Improved unit test. (related to #129)
4ec8e91
Fixed bug in diagnostics.
b7add82
Registrations that where wrapped with three or more decorators didn't get diagnosed. (fixes #129)
dotnetjunkie
No branches or pull requests
Using the following definitions:
The following code throws an 'lifestyle mismatch' exception:
And so does this code:
But the following code does not throw an exception:
When more than two decorators are wrapped around a type, everything deeper than the second decorator doesn't get validated anymore.
The text was updated successfully, but these errors were encountered: