71 references to _typeSymbols
Microsoft.Extensions.Configuration.Binder.SourceGeneration (71)
ConfigurationBindingGenerator.Parser.cs (55)
43
if (
_typeSymbols
is not { IConfiguration: { }, ConfigurationBinder: { } })
60
EmitNotNullIfNotNull =
_typeSymbols
.NotNullIfNotNullAttribute is not null,
69
!
_typeSymbols
.Compilation.IsSymbolAccessibleWithin(type,
_typeSymbols
.Compilation.Assembly) ||
89
if (SymbolEqualityComparer.Default.Equals(candidateBinderType,
_typeSymbols
.ConfigurationBinder))
93
else if (SymbolEqualityComparer.Default.Equals(candidateBinderType,
_typeSymbols
.OptionsBuilderConfigurationExtensions))
97
else if (SymbolEqualityComparer.Default.Equals(candidateBinderType,
_typeSymbols
.OptionsConfigurationServiceCollectionExtensions))
202
else if (SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.IConfigurationSection))
296
if (SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.CultureInfo))
300
else if (SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.DateTimeOffset) ||
301
SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.DateOnly) ||
302
SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.TimeOnly) ||
303
SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.TimeSpan))
307
else if (SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.Int128) ||
308
SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.Half) ||
309
SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.UInt128))
313
else if (SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.Uri))
317
else if (SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.Version) ||
318
SymbolEqualityComparer.Default.Equals(type,
_typeSymbols
.Guid))
387
bool isDictionary =
_typeSymbols
.GenericICollection is not null && GetInterface(type,
_typeSymbols
.GenericIDictionary_Unbound) is not null;
419
else if (
_typeSymbols
.Dictionary is not null &&
420
(IsInterfaceMatch(type,
_typeSymbols
.GenericIDictionary_Unbound) || IsInterfaceMatch(type,
_typeSymbols
.IDictionary)))
426
else if (
_typeSymbols
.Dictionary is not null && IsInterfaceMatch(type,
_typeSymbols
.IReadOnlyDictionary_Unbound))
458
bool isCollection =
_typeSymbols
.GenericICollection is not null && GetInterface(type,
_typeSymbols
.GenericICollection_Unbound) is not null;
495
else if ((IsInterfaceMatch(type,
_typeSymbols
.GenericICollection_Unbound) || IsInterfaceMatch(type,
_typeSymbols
.GenericIList_Unbound)))
501
else if (IsInterfaceMatch(type,
_typeSymbols
.GenericIEnumerable_Unbound))
509
else if (IsInterfaceMatch(type,
_typeSymbols
.ISet_Unbound))
515
else if (IsInterfaceMatch(type,
_typeSymbols
.IReadOnlySet_Unbound))
523
else if (IsInterfaceMatch(type,
_typeSymbols
.IReadOnlyList_Unbound) || IsInterfaceMatch(type,
_typeSymbols
.IReadOnlyCollection_Unbound))
551
Conversion conversion =
_typeSymbols
.Compilation.ClassifyConversion(source, dest);
564
if (SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IntPtr, type) ||
565
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.UIntPtr, type) ||
566
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.SerializationInfo, type) ||
567
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.ParameterInfo, type) ||
568
IsAssignableTo(type,
_typeSymbols
.MemberInfo) ||
569
IsAssignableTo(type,
_typeSymbols
.Delegate))
728
AttributeData? attributeData = attributes.FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass,
_typeSymbols
.ConfigurationKeyNameAttribute));
730
bool isIgnored = attributes.Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass,
_typeSymbols
.ConfigurationIgnoreAttribute));
811
INamedTypeSymbol? candidate = GetInterface(type,
_typeSymbols
.GenericIEnumerable_Unbound);
825
INamedTypeSymbol? candidate = GetInterface(type,
_typeSymbols
.GenericIDictionary_Unbound) ?? GetInterface(type,
_typeSymbols
.IReadOnlyDictionary_Unbound);
834
if (IsInterfaceMatch(type,
_typeSymbols
.IDictionary))
836
keyType =
_typeSymbols
.String;
837
elementType =
_typeSymbols
.String;
847
type is INamedTypeSymbol namedType && GetInterface(namedType,
_typeSymbols
.IEnumerable) is not null;
998
_emitGenericParseEnum =
_typeSymbols
.Enum.GetMembers("Parse").Any(m => m is IMethodSymbol methodSymbol && methodSymbol.IsGenericMethod);
1006
if (
_typeSymbols
.ArgumentNullException is not null)
1008
var throwIfNullMethods =
_typeSymbols
.ArgumentNullException.GetMembers("ThrowIfNull");
1019
&& secondParam.Name == "paramName" && secondParam.Type.Equals(
_typeSymbols
.String, SymbolEqualityComparer.Default))
Parser\ConfigurationBinder.cs (5)
45
if (!SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, @params[0].Type))
62
else if (SymbolEqualityComparer.Default.Equals(@params[2].Type,
_typeSymbols
.ActionOfBinderOptions))
140
if (!SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, @params[0].Type))
161
else if (paramCount is 2 && SymbolEqualityComparer.Default.Equals(@params[1].Type,
_typeSymbols
.ActionOfBinderOptions))
179
else if (paramCount is 3 && SymbolEqualityComparer.Default.Equals(@params[2].Type,
_typeSymbols
.ActionOfBinderOptions))
Parser\OptionsBuilderConfigurationExtensions.cs (4)
23
!SymbolEqualityComparer.Default.Equals(
_typeSymbols
.OptionsBuilderOfT_Unbound, genericType.ConstructUnboundGenericType()))
51
if (!SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, @params[1].Type))
59
3 when SymbolEqualityComparer.Default.Equals(
_typeSymbols
.ActionOfBinderOptions, @params[2].Type) =>
80
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.ActionOfBinderOptions, @params[2].Type))
Parser\OptionsConfigurationServiceCollectionExtensions.cs (7)
23
!SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IServiceCollection, @params[0].Type))
35
if (paramCount is 2 && SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, @params[1].Type))
45
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, thirdParamType))
49
else if (SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, secondParamType) &&
50
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.ActionOfBinderOptions, thirdParamType))
61
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.IConfiguration, @params[2].Type) &&
62
SymbolEqualityComparer.Default.Equals(
_typeSymbols
.ActionOfBinderOptions, @params[3].Type))