Some of the features that provided in this libary is
- Decoration pattern registration - Simple, chained, and type-safe (Both for Component and BasedOnDescriptor)
- ResolveByParameterName in construction (without explicit registration)
- AppSettings Convention
- Static access for ExtenionMethod classes
Sample codes are included in repostory
This feature is the one the most needed feature in registration. However there are some tricks to cover this feature, it is too confusing and complex. Extension library solves this need by simple extension methods. Extension methods handles type-safety and decoration order
Component
.For<IMathService>()
.ImplementedBy<DefaultMathService>()
.Decorated().By<LogDecorator>()
.Decorated().By<ExceptionDecorator>()
Also it supports BasedOnDescriptor TODO
This feature provides to ability to resolve any class, if only constructor parameter is matched with registration name Detailed information can be found at here
Extension library solves this need just by adding ResolveByNameConvention resolver.
container.Kernel.Resolver.AddSubResolver(new ResolveByNameConvention(container));
And register with name
Component
.For<ILogger>()
.ImplementedBy<ConsoleLogger>()
.NamedAsParameter()
.IsDefault(),
Component
.For<ILogger>()
.ImplementedBy<TraceLogger>()
.NamedAsParameter()
That's it. Now you can own them in constructor with constructor parameter name
public ResolveByNameDemo(ILogger logger, ILogger consoleLogger, ILogger traceLogger)
{
this.logger = logger;
this.consoleLogger = consoleLogger;
this.traceLogger = traceLogger;
}
See the releases.
Windsor Extension is licensed under the Apache 2.0 license. Refer to LICENSE for more information
Icons made by Freepik from Flaticon is licensed by Creative Commons BY 3.0