DefaultDependencyResolver
Default implementation for IDependencyResolver.
This implementation is quite simple, but still should be useful
for 99% of situations.
public DefaultDependencyResolver()
Registers a sub resolver instance
public bool CanResolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
Returns true if the resolver is able to satisfy the specified dependency.
protected virtual bool CanResolveParameterDependency(ComponentModel model, DependencyModel dependency)
protected virtual bool CanResolveServiceDependency(CreationContext context, ComponentModel model, DependencyModel dependency)
Extracts the component name from the a ref strings which is
${something}
Initializes this instance with the specified dependency delegate.
protected virtual ParameterModel ObtainParameterModelMatchingDependency(DependencyModel dependency, ComponentModel model)
protected virtual CreationContext RebuildContextForParameter(CreationContext current, Type parameterType)
This method rebuild the context for the parameter type.
Naive implementation.
Unregisters a sub resolver instance previously registered
public object Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
Try to resolve the dependency by checking the parameters in
the model or checking the Kernel for the requested service.
protected virtual object ResolveParameterDependency(CreationContext context, ComponentModel model, DependencyModel dependency)
protected virtual object ResolveServiceDependency(CreationContext context, ComponentModel model, DependencyModel dependency)