@@ -64,7 +64,6 @@ namespace DryIoc
64
64
using MemberAssignmentExpr = System.Linq.Expressions.MemberAssignment;
65
65
using FactoryDelegateExpr = System.Linq.Expressions.Expression<FactoryDelegate>;
66
66
using global::Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection.DryIoc;
67
-
68
67
#endif
69
68
70
69
/// <summary>IoC Container. Documentation is available at https://bitbucket.org/dadhi/dryioc. </summary>
@@ -432,11 +431,11 @@ private void ThrowIfContainerDisposed()
432
431
_scopeContext == null ? _ownCurrentScope : _scopeContext.GetCurrentOrDefault();
433
432
434
433
/// <inheritdoc />
435
- public IResolverContext WithCurrentScope(IScope scope)
434
+ public IResolverContext WithCurrentScope(IScope scope, bool preferInterpretaion = false )
436
435
{
437
436
ThrowIfContainerDisposed();
438
437
return new Container(Rules, _registry, _singletonScope, _scopeContext,
439
- scope, _disposed, _disposeStackTrace, parent: this, root: _root ?? this);
438
+ scope, _disposed, _disposeStackTrace, parent: this, root: _root ?? this, preferInterpretation: preferInterpretaion );
440
439
}
441
440
442
441
void IResolverContext.UseInstance(Type serviceType, object instance, IfAlreadyRegistered ifAlreadyRegistered,
@@ -693,7 +692,7 @@ public IContainer With(Rules rules, IScopeContext scopeContext, RegistrySharing
693
692
: Ref.Of(_registry.Value.WithoutCache());
694
693
695
694
return new Container(rules, registry, singletonScope, scopeContext,
696
- _ownCurrentScope, _disposed, _disposeStackTrace, _parent, _root);
695
+ _ownCurrentScope, _disposed, _disposeStackTrace, _parent, _root, _preferInterpretation );
697
696
}
698
697
699
698
/// <summary>Produces new container which prevents any further registrations.</summary>
@@ -2593,7 +2592,7 @@ public interface IResolverContext : IResolver, IDisposable
2593
2592
IScope CurrentScope { get; }
2594
2593
2595
2594
/// <summary>Creates resolver context with specified current scope (or container which implements the context).</summary>
2596
- IResolverContext WithCurrentScope(IScope scope);
2595
+ IResolverContext WithCurrentScope(IScope scope, bool preferInterpretation );
2597
2596
2598
2597
/// <summary>Allows to put instance into the scope.</summary>
2599
2598
void UseInstance(Type serviceType, object instance, IfAlreadyRegistered IfAlreadyRegistered,
@@ -2687,7 +2686,7 @@ public static IScope GetNamedScope(this IResolverContext r, object name, bool th
2687
2686
/// handler.Handle(data);
2688
2687
/// }
2689
2688
/// ]]></code></example>
2690
- public static IResolverContext OpenScope(this IResolverContext r, object name = null, bool trackInParent = false)
2689
+ public static IResolverContext OpenScope(this IResolverContext r, object name = null, bool trackInParent = false, bool preferInterpretation = false )
2691
2690
{
2692
2691
// todo: Should we use OwnCurrentScope, then should it be in ResolverContext?
2693
2692
var openedScope = r.ScopeContext == null
@@ -2697,7 +2696,7 @@ public static IResolverContext OpenScope(this IResolverContext r, object name =
2697
2696
if (trackInParent)
2698
2697
(openedScope.Parent ?? r.SingletonScope).TrackDisposable(openedScope);
2699
2698
2700
- return r.WithCurrentScope(openedScope);
2699
+ return r.WithCurrentScope(openedScope, preferInterpretation );
2701
2700
}
2702
2701
}
2703
2702
0 commit comments