test/Shared/FunctionalTests.Transitional/TestHelpers/MutableResolver.cs
/// <summary>
/// Adds or replaces a resolver for a dependency of type <typeparamref name="TResolver" />.
/// </summary>
/// <remarks>
/// Remember to call <see cref="ClearResolvers" /> from a <c>finally</c> block or Dispose method after using this method.
/// </remarks>
/// <typeparam name="TResolver">The type of dependency to resolve.</typeparam>
/// <param name="resolver">A delegate that takes a key object and returns a dependency instance.</param>
Adds or replaces a resolver for a dependency of type .
Adds or replaces a resolver for a dependency of type .
public static void AddResolver<TResolver>(Func<object, object> resolver)
        {
            if (typeof(TResolver) == typeof(Func<IDbExecutionStrategy>))
            {
                ClearCache();
            }
            _resolvers[typeof(TResolver)] = resolver;
        }
public static void AddResolver < TResolver > ( Func < object , object > resolver ) { if ( typeof ( TResolver ) == typeof ( Func < IDbExecutionStrategy > ) ) { ClearCache ( ) ; } _resolvers [ typeof ( TResolver ) ] = resolver ; }
Adds or replaces a resolver for a dependency of type .
Adds or replaces a resolver for a dependency of type .
resolver
Func<object, object>
A delegate that takes a key object and returns a dependency instance.
A delegate that takes a key object and returns a dependency instance .
remarks
Remember to call  from a finally
Remember to call from a finally
typeparam
The type of dependency to resolve.
The type of dependency to resolve .