-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Breaking change ❕This change breaks public APIThis change breaks public APIEnhancement 🔨Improvement of existing featuresImprovement of existing features
Description
ResolverOverride
During resolution, types derived from ResolverOverride
are used to provide dependency values that override those resolved from the container.
Problem
public abstract class ResolverOverride
{
. . .
public virtual ResolveDelegate<TContext> GetResolver<TContext>(Type type)
where TContext : IResolveContext
{
// Resolver factory code here
}
. . .
}
The original design was to require a GetResolver
call with the required Type,
and if it matched, the resolver was returned. Calling the resolver returned the appropriate value. The override instance was deciding if it held the appropriate value and if it matched the required type. In version 5.x, this logic was moved into the container, making this approach obsolete. But, it is still uses two method calls to get the value.
Solution
The ResolverOverride
class no longer implements method GetResolver
. Instead it implements IResolve
interface directly and provides held value in one step.
Metadata
Metadata
Assignees
Labels
Breaking change ❕This change breaks public APIThis change breaks public APIEnhancement 🔨Improvement of existing featuresImprovement of existing features