20 references to section
Microsoft.Extensions.Configuration.Binder.SourceGeneration (20)
Emitter\CoreBindingHelpers.cs (17)
133_writer.WriteLine($"return {Identifier.section};"); 167if ({{Identifier.configuration}} is not {{Identifier.IConfigurationSection}} {{Identifier.section}}) 185_writer.WriteLine($@"{Identifier.IConfigurationSection} {Identifier.section} = {GetSectionFromConfigurationExpression(Identifier.key, addQuotes: false)};"); 188EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.section}, {Identifier.key}: null, out string? {Identifier.value}) && !string.IsNullOrEmpty({Identifier.value}))"); 503if ({{Identifier.configuration}} is {{Identifier.ConfigurationSection}} {{Identifier.section}}) 505return {{Identifier.section}}.TryGetValue({{Identifier.key}}, out {{Identifier.value}}); 528foreach ({{Identifier.IConfigurationSection}} {{Identifier.section}} in {{Identifier.configuration}}.{{Identifier.GetChildren}}()) 721EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.section}, {Identifier.key}: null, out string? {Identifier.value}))"); 733_writer.WriteLine($"{addExpr}({Identifier.section});"); 743EmitBindingLogic(complexType, Identifier.value, Identifier.section, InitializationKind.Declaration, ValueDefaulting.None); 760EmitStartBlock($"if (!string.IsNullOrEmpty({Expression.sectionValue}) && !{Identifier.section}.{Identifier.GetChildren}().{Identifier.Any}())"); 788EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.section}, {Identifier.key}: null, out string? {Identifier.value}))"); 800_writer.WriteLine($"{instanceIdentifier}[{parsedKeyExpr}] = {Identifier.section};"); 840EmitObjectInit(complexElementType, Identifier.element, InitializationKind.SimpleAssignment, Identifier.section); 861Identifier.section, 1098string sectionIdentifier = GetIncrementalIdentifier(Identifier.section); 1532EmitStartBlock($"foreach ({Identifier.IConfigurationSection} {Identifier.section} in {Identifier.configuration}.{Identifier.GetChildren}())");
Emitter\Helpers.cs (1)
82public 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}});