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}))");
506
if ({{Identifier.configuration}} is {{Identifier.ConfigurationSection}} {{Identifier.
section
}})
508
return {{Identifier.
section
}}.TryGetValue({{Identifier.key}}, out {{Identifier.value}});
531
foreach ({{Identifier.IConfigurationSection}} {{Identifier.
section
}} in {{Identifier.configuration}}.{{Identifier.GetChildren}}())
724
EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.
section
}, {Identifier.key}: null, out string? {Identifier.value}))");
736
_writer.WriteLine($"{addExpr}({Identifier.
section
});");
746
EmitBindingLogic(complexType, Identifier.value, Identifier.
section
, InitializationKind.Declaration, ValueDefaulting.None);
763
EmitStartBlock($"if (!string.IsNullOrEmpty({Expression.sectionValue}) && !{Identifier.
section
}.{Identifier.GetChildren}().{Identifier.Any}())");
791
EmitStartBlock($"if ({Identifier.TryGetConfigurationValue}({Identifier.
section
}, {Identifier.key}: null, out string? {Identifier.value}))");
803
_writer.WriteLine($"{instanceIdentifier}[{parsedKeyExpr}] = {Identifier.
section
};");
843
EmitObjectInit(complexElementType, Identifier.element, InitializationKind.SimpleAssignment, Identifier.
section
);
864
Identifier.
section
,
1099
string sectionIdentifier = GetIncrementalIdentifier(Identifier.
section
);
1550
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}});