Skip to content

Commit

Permalink
Consolidated handling of isUnique parameter for TryGet (fixes #378) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lord-executor authored and scott-xu committed Apr 23, 2022
1 parent 06b865a commit e5166eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ninject/Syntax/ResolutionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static object TryGet(this IResolutionRoot root, Type service, params IPar
/// </returns>
public static object TryGet(this IResolutionRoot root, Type service, string name, params IParameter[] parameters)
{
return TryGet(() => GetResolutionIterator(root, service, b => b.Name == name, parameters, true, false));
return TryGet(() => GetResolutionIterator(root, service, b => b.Name == name, parameters, true, true));
}

/// <summary>
Expand All @@ -296,7 +296,7 @@ public static object TryGet(this IResolutionRoot root, Type service, string name
/// </returns>
public static object TryGet(this IResolutionRoot root, Type service, Func<IBindingMetadata, bool> constraint, params IParameter[] parameters)
{
return TryGet(() => GetResolutionIterator(root, service, constraint, parameters, true, false));
return TryGet(() => GetResolutionIterator(root, service, constraint, parameters, true, true));
}

/// <summary>
Expand Down

0 comments on commit e5166eb

Please # to comment.