Skip to content

Commit

Permalink
fixed: #557
Browse files Browse the repository at this point in the history
  • Loading branch information
dadhi committed Feb 16, 2023
1 parent 6a4f828 commit 87ddfd7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DryIoc/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ private Factory GetRuleSelectedServiceFactoryOrDefault(Rules rules,
// optimize for the case with the single factory
if (factories.Length == 1)
return request.MatchFactoryConditionAndMetadata(details, factories[0].Value)
? rules.FactorySelector(request, factories[0].Value, null)
? rules.FactorySelector(request, null, factories)
: null;

// Sort in registration order
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using NUnit.Framework;

namespace DryIoc.IssuesTests
Expand All @@ -16,7 +15,7 @@ public int Run()
public void Test1()
{
var rules = Rules.Default
// .WithFactorySelector(Rules.SelectLastRegisteredFactory())
.WithFactorySelector(Rules.SelectLastRegisteredFactory())
.WithConcreteTypeDynamicRegistrations(reuse: Reuse.Transient)
.With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))
.WithFuncAndLazyWithoutRegistration()
Expand Down
3 changes: 2 additions & 1 deletion test/DryIoc.TestRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ void Run(Func<int> run, string name = null)
new GHIssue532_WithUseInterpretation_still_use_DynamicMethod_and_ILEmit(),
new GHIssue536_DryIoc_Exception_in_a_Constructor_of_a_Dependency_does_tunnel_through_Resolve_call(),
new GHIssue546_Generic_type_constraint_resolution_doesnt_see_arrays_as_IEnumerable(),
new GHIssue554_System_NullReferenceException_Object_reference_not_set_to_an_instance_of_an_object()
new GHIssue554_System_NullReferenceException_Object_reference_not_set_to_an_instance_of_an_object(),
new GHIssue557_WithFactorySelector_allows_to_Resolve_the_keyed_service_as_non_keyed(),
};

// Parallel.ForEach(tests, x => Run(x.Run)); // todo: @perf enable and test when more tests are added
Expand Down

0 comments on commit 87ddfd7

Please sign in to comment.