We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0988256 commit d896569Copy full SHA for d896569
2 files changed
src/Pure.DI.Core/Core/Code/RootCodeBuilder.cs
@@ -171,7 +171,9 @@ private void FinishSingleInstanceCheck(CodeContext ctx)
171
var parent = "";
172
if (var.AbstractNode.ActualLifetime == Singleton && constructors.IsEnabled(ctx.RootContext.Graph))
173
{
174
- parent = $"{Names.RootFieldName}.";
+ parent = string.IsNullOrWhiteSpace(ctx.RootContext.Graph.Source.Hints.ScopeFactoryName)
175
+ ? $"{Names.RootFieldName}."
176
+ : $"{Names.RootVarName}.";
177
}
178
179
lines.AppendLine($"{parent}{Names.DisposablesFieldName}[{parent}{Names.DisposeIndexFieldName}++] = {var.Name};");
0 commit comments