Skip to content

Commit

Permalink
CircularReferenceChecker print improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Jul 22, 2021
1 parent 731c99f commit 54c02d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Noggog.Autofac/Validation/CircularReferenceChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ private void Check(Type type, ImmutableList<Type> passed)
{
if (passed.Contains(type))
{
throw new AutofacValidationException($"Circular dependency detected. {string.Join(" --> ", passed.Select(x => x.Name))}");
throw new AutofacValidationException(
$"Circular dependency detected. {string.Join(" --> ", passed.SkipWhile(x => x != type).And(type).Select(x => x.Name))}");
}

if (!_concreteTypeToDependenciesProvider.ConcreteTypeMapping.TryGetValue(type, out var deps)) return;
Expand Down

0 comments on commit 54c02d2

Please sign in to comment.