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 17, 2022
1 parent 2d08ae5 commit 36e5634
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 @@ -247,7 +247,7 @@ public static object TryGet(this IResolutionRoot root, Type service, params IPar
/// <returns>An instance of the service, or <see langword="null"/> if no implementation was available.</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 @@ -260,7 +260,7 @@ public static object TryGet(this IResolutionRoot root, Type service, string name
/// <returns>An instance of the service, or <see langword="null"/> if no implementation was available.</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 36e5634

Please sign in to comment.