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