Skip to content

Commit

Permalink
fix: Fixing non generic method OnType() on ParameterOverrides
Browse files Browse the repository at this point in the history
Fixed #164
  • Loading branch information
ENikS committed Jun 5, 2020
1 parent 2a3a057 commit c523cd9
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/Dependency/Resolution/Collections/ParameterOverrides.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ public void Add(string key, object value)
_values.Add(new Tuple<string, object>(key, value));
}

///// <summary>
///// When implemented in derived classes, this method is called from the <see cref="OverrideCollection{TOverride,TKey,TValue}.Add"/>
///// method to create the actual <see cref="ResolverOverride"/> objects.
///// </summary>
///// <param name="key">Key value to create the resolver.</param>
///// <param name="value">InjectionParameterValue to store in the resolver.</param>
///// <returns>The created <see cref="ResolverOverride"/>.</returns>
//protected override ParameterOverride MakeOverride(string key, object value)
//{
// return new ParameterOverride(key, value);
//}


#region Type Based Override

/// <summary>
Expand All @@ -59,7 +46,8 @@ public ResolverOverride[] OnType<T>()
/// <returns>The new override.</returns>
public ResolverOverride[] OnType(Type targetType)
{
return new ResolverOverride[0];
return _values.Select(p => new ParameterOverride(p.Item1, p.Item2).OnType(targetType))
.ToArray();
}

#endregion
Expand Down

0 comments on commit c523cd9

Please sign in to comment.