20 references to section
Microsoft.Extensions.Configuration.Binder.SourceGeneration (20)
Emitter\CoreBindingHelpers.cs (17)
132_writer.WriteLine($"return {Identifier.section};"); 166if ({{Identifier.configuration}} is not {{Identifier.IConfigurationSection}} {{Identifier.section}}) 184_writer.WriteLine($@"{Identifier.IConfigurationSection} {Identifier.section} = {GetSectionFromConfigurationExpression(Identifier.key, addQuotes: false)};"); 187EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.section}, {Identifier.key}: null, out string? {Identifier.value}) && !string.IsNullOrEmpty({Identifier.value}))"); 498if ({{Identifier.configuration}} is {{Identifier.ConfigurationSection}} {{Identifier.section}}) 500return {{Identifier.section}}.TryGetValue({{Identifier.key}}, out {{Identifier.value}}); 523foreach ({{Identifier.IConfigurationSection}} {{Identifier.section}} in {{Identifier.configuration}}.{{Identifier.GetChildren}}()) 716EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.section}, {Identifier.key}: null, out string? {Identifier.value}))"); 728_writer.WriteLine($"{addExpr}({Identifier.section});"); 738EmitBindingLogic(complexType, Identifier.value, Identifier.section, InitializationKind.Declaration, ValueDefaulting.None); 755EmitStartBlock($"if (!string.IsNullOrEmpty({Expression.sectionValue}) && !{Identifier.section}.{Identifier.GetChildren}().{Identifier.Any}())"); 783EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.section}, {Identifier.key}: null, out string? {Identifier.value}))"); 795_writer.WriteLine($"{instanceIdentifier}[{parsedKeyExpr}] = {Identifier.section};"); 823EmitObjectInit(complexElementType, Identifier.element, InitializationKind.SimpleAssignment, Identifier.section); 840Identifier.section, 974string sectionIdentifier = GetIncrementalIdentifier(Identifier.section); 1349EmitStartBlock($"foreach ({Identifier.IConfigurationSection} {Identifier.section} in {Identifier.configuration}.{Identifier.GetChildren}())");
Emitter\Helpers.cs (1)
80public 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}});