20 references to section
Microsoft.Extensions.Configuration.Binder.SourceGeneration (20)
Emitter\CoreBindingHelpers.cs (17)
133
_writer.WriteLine($"return {Identifier.
section
};");
167
if ({{Identifier.configuration}} is not {{Identifier.IConfigurationSection}} {{Identifier.
section
}})
185
_writer.WriteLine($@"{Identifier.IConfigurationSection} {Identifier.
section
} = {GetSectionFromConfigurationExpression(Identifier.key, addQuotes: false)};");
188
EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.
section
}, {Identifier.key}: null, out string? {Identifier.value}) && !string.IsNullOrEmpty({Identifier.value}))");
503
if ({{Identifier.configuration}} is {{Identifier.ConfigurationSection}} {{Identifier.
section
}})
505
return {{Identifier.
section
}}.TryGetValue({{Identifier.key}}, out {{Identifier.value}});
528
foreach ({{Identifier.IConfigurationSection}} {{Identifier.
section
}} in {{Identifier.configuration}}.{{Identifier.GetChildren}}())
721
EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.
section
}, {Identifier.key}: null, out string? {Identifier.value}))");
733
_writer.WriteLine($"{addExpr}({Identifier.
section
});");
743
EmitBindingLogic(complexType, Identifier.value, Identifier.
section
, InitializationKind.Declaration, ValueDefaulting.None);
760
EmitStartBlock($"if (!string.IsNullOrEmpty({Expression.sectionValue}) && !{Identifier.
section
}.{Identifier.GetChildren}().{Identifier.Any}())");
788
EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.
section
}, {Identifier.key}: null, out string? {Identifier.value}))");
800
_writer.WriteLine($"{instanceIdentifier}[{parsedKeyExpr}] = {Identifier.
section
};");
840
EmitObjectInit(complexElementType, Identifier.element, InitializationKind.SimpleAssignment, Identifier.
section
);
861
Identifier.
section
,
1098
string sectionIdentifier = GetIncrementalIdentifier(Identifier.
section
);
1532
EmitStartBlock($"foreach ({Identifier.IConfigurationSection} {Identifier.
section
} in {Identifier.configuration}.{Identifier.GetChildren}())");
Emitter\Helpers.cs (1)
82
public const string section = nameof(
section
);
Emitter\OptionsBuilderConfigurationExtensions.cs (2)
74
{{Identifier.IConfiguration}} {{Identifier.
section
}} = string.Equals(string.Empty, {{Identifier.configSectionPath}}, StringComparison.OrdinalIgnoreCase) ? {{Identifier.config}} : {{Identifier.config}}.{{Identifier.GetSection}}({{Identifier.configSectionPath}});
75
{{nameof(MethodsToGen_CoreBindingHelper.BindCoreMain)}}({{Identifier.
section
}}, {{Identifier.instance}}, typeof({{Identifier.TOptions}}), {{Identifier.configureBinder}});