151 references to GetUnderlyingType
aspire (2)
Commands\SettingsSchemaBuilder.cs (2)
33var underlyingType = Nullable.GetUnderlyingType(type) ?? type; 122var propertyType = Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType;
Aspire.Hosting (1)
Ats\CollectionExports.cs (1)
142var normalizedKeyType = Nullable.GetUnderlyingType(keyType) ?? keyType;
Aspire.Hosting.RemoteHost (13)
Ats\AtsMarshaller.cs (3)
122if (Nullable.GetUnderlyingType(type) is { } underlying) 759var underlying = Nullable.GetUnderlyingType(type); 858var underlyingType = Nullable.GetUnderlyingType(targetType) ?? targetType;
Ats\CapabilityDispatcher.cs (2)
721if (paramType.IsValueType && Nullable.GetUnderlyingType(paramType) is null) 940var underlyingType = Nullable.GetUnderlyingType(unionMemberType) ?? unionMemberType;
Ats\PolyglotCapabilityInvocationException.cs (1)
400(!actualResourceType.IsValueType || Nullable.GetUnderlyingType(actualResourceType) is not null))
AtsCapabilityScanner.cs (7)
1169Nullable.GetUnderlyingType(property.PropertyType) is not null || 2146var isNullable = Nullable.GetUnderlyingType(paramType) != null; 2399var underlyingType = Nullable.GetUnderlyingType(type); 2595Nullable.GetUnderlyingType(declaredType) is not null; 2672var underlyingType = Nullable.GetUnderlyingType(type); 3167var underlyingType = Nullable.GetUnderlyingType(type); 3881if (Nullable.GetUnderlyingType(type) is { } nullableUnderlyingType)
Aspire.Hosting.Tests (4)
Backchannel\BackchannelContractTests.cs (2)
147? Nullable.GetUnderlyingType(prop.PropertyType) is not null 339var propertyType = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType;
ResourceNotificationTests.cs (2)
1727if (Nullable.GetUnderlyingType(type) is not null || 1769if (Nullable.GetUnderlyingType(type) is { } underlyingType)
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
3871Type parameterType = Nullable.GetUnderlyingType(type);
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.AspNetCore.Components (4)
BindConverter.cs (3)
1691var underlyingType = Nullable.GetUnderlyingType(typeof(T))!; 1841else if (typeof(T).IsEnum || Nullable.GetUnderlyingType(typeof(T)) is Type { IsEnum: true } innerType) 2061else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum)
NavigationManagerExtensions.cs (1)
719var underlyingParameterValueType = Nullable.GetUnderlyingType(parameterValueType) ?? parameterValueType;
Microsoft.AspNetCore.Components.Endpoints (9)
FormMapping\Factories\NullableConverterFactory.cs (2)
17var underlyingType = Nullable.GetUnderlyingType(type); 25var underlyingType = Nullable.GetUnderlyingType(type);
FormMapping\Metadata\FormDataMetadataFactory.cs (1)
82(Nullable.GetUnderlyingType(type) is { } underlyingType &&
Forms\ClientValidationCache.cs (1)
168propertyType = Nullable.GetUnderlyingType(propertyType) ?? propertyType;
Forms\DataAnnotationsLocalizer.cs (1)
124var name = (Nullable.GetUnderlyingType(type) ?? type).Name;
Serialization\JsonStoredDataSerializer.cs (2)
61type = Nullable.GetUnderlyingType(type) ?? type; 143type = Nullable.GetUnderlyingType(type) ?? type;
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
TempData\TempDataCascadingValueSupplier.cs (1)
124_underlyingType = Nullable.GetUnderlyingType(propertyType) ?? propertyType;
Microsoft.AspNetCore.Components.Forms (1)
FieldIdentifier.cs (1)
285Nullable.GetUnderlyingType(expression.Type)?.IsInstanceOfType(value) == true)
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\PropertyColumn.cs (1)
55var nullableUnderlyingTypeOrNull = Nullable.GetUnderlyingType(typeof(TProp));
Microsoft.AspNetCore.Components.Web (3)
Forms\InputBase.cs (1)
295_nullableUnderlyingType = Nullable.GetUnderlyingType(typeof(TValue));
Forms\InputDate.cs (1)
55var type = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue);
Forms\InputNumber.cs (1)
22var targetType = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue);
Microsoft.AspNetCore.Connections.Abstractions (1)
src\aspnetcore\src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.AspNetCore.Http.Abstractions (2)
src\aspnetcore\src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Http.Extensions (10)
RequestDelegateFactory.cs (4)
1596var isNullable = Nullable.GetUnderlyingType(parameterType) != null || 1712var underlyingNullableType = Nullable.GetUnderlyingType(targetParseType); 2015if (parameterType.IsValueType && Nullable.GetUnderlyingType(parameterType) is null) 2023var underlyingType = Nullable.GetUnderlyingType(parameterType);
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (2)
17var underlyingType = Nullable.GetUnderlyingType(type); 25var underlyingType = Nullable.GetUnderlyingType(type);
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (1)
82(Nullable.GetUnderlyingType(type) is { } underlyingType &&
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (2)
69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType;
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
97var isNullable = Nullable.GetUnderlyingType(parameters[i].ParameterType) != null ||
Microsoft.AspNetCore.JsonPatch (2)
Internal\DynamicObjectAdapter.cs (1)
69&& Nullable.GetUnderlyingType(property.GetType()) == null)
Internal\PocoAdapter.cs (1)
97&& Nullable.GetUnderlyingType(jsonProperty.PropertyType) == null)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Internal\PocoAdapter.cs (1)
94&& Nullable.GetUnderlyingType(jsonProperty.PropertyType) == null)
Microsoft.AspNetCore.Mvc.Abstractions (5)
ModelBinding\ModelMetadata.cs (3)
652modelType = Nullable.GetUnderlyingType(modelType) ?? modelType; 751IsNullableValueType = Nullable.GetUnderlyingType(ModelType) != null; 753UnderlyingOrModelType = Nullable.GetUnderlyingType(ModelType) ?? ModelType;
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (2)
69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType;
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
EndpointModelMetadata.cs (1)
57var underlyingType = Nullable.GetUnderlyingType(type) ?? type;
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
97var isNullable = Nullable.GetUnderlyingType(parameters[i].ParameterType) != null ||
Microsoft.AspNetCore.Mvc.Core (4)
ModelBinding\Binders\TryParseModelBinder.cs (1)
109modelType = Nullable.GetUnderlyingType(modelType) ?? modelType;
ModelBinding\ModelBindingHelper.cs (1)
748return Nullable.GetUnderlyingType(destinationType) ?? destinationType;
src\aspnetcore\src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsMetadataProvider.cs (1)
159var underlyingType = Nullable.GetUnderlyingType(context.Key.ModelType) ?? context.Key.ModelType;
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
BsonTempDataSerializer.cs (1)
209actualType = Nullable.GetUnderlyingType(actualType) ?? actualType;
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
CachedExpressionCompiler.cs (1)
237var isNullableValueType = type.IsValueType && Nullable.GetUnderlyingType(type) != null;
Filters\LifecycleProperty.cs (1)
21_isReferenceTypeOrNullable = !propertyType.IsValueType || Nullable.GetUnderlyingType(propertyType) != null;
Infrastructure\DefaultTempDataSerializer.cs (1)
221type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.OpenApi (11)
Extensions\JsonNodeSchemaExtensions.cs (3)
210var underlyingType = Nullable.GetUnderlyingType(type); 360var enumType = Nullable.GetUnderlyingType(paramType) ?? paramType; 483if (Nullable.GetUnderlyingType(unionTypeInfo.Type) is { } underlyingType
Extensions\JsonTypeInfoExtensions.cs (1)
56var underlyingType = Nullable.GetUnderlyingType(type);
Services\OpenApiDocumentService.cs (1)
962? Nullable.GetUnderlyingType(parameter.Type) ?? parameter.Type
Services\Schemas\OpenApiSchemaService.cs (3)
109var underlyingType = Nullable.GetUnderlyingType(context.TypeInfo.Type) ?? context.TypeInfo.Type; 274&& (Nullable.GetUnderlyingType(paramType) ?? paramType) is { IsEnum: true } enumType) 576var underlyingType = Nullable.GetUnderlyingType(type) ?? type;
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (2)
69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType;
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
97var isNullable = Nullable.GetUnderlyingType(parameters[i].ParameterType) != null ||
Microsoft.AspNetCore.Routing (1)
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Routing.Abstractions (1)
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.Extensions.AI.Abstractions (3)
Utilities\AIJsonUtilities.Schema.Create.cs (3)
338if (Nullable.GetUnderlyingType(ctx.TypeInfo.Type) is Type nullableElement) 936return parameterType.IsValueType && Nullable.GetUnderlyingType(parameterType) is null 952if (Nullable.GetUnderlyingType(parameterType) is Type underlyingType && underlyingType.IsEnum)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Utilities\AIJsonUtilitiesTests.cs (1)
378if (Nullable.GetUnderlyingType(type) is { } elementType)
Microsoft.Extensions.Caching.Hybrid (1)
Internal\ImmutableTypeCache.cs (1)
57if (Nullable.GetUnderlyingType(type) is { } nullable)
Microsoft.Extensions.Configuration.Binder (3)
ConfigurationBinder.cs (2)
614instance = Activator.CreateInstance(Nullable.GetUnderlyingType(type) ?? type); 997return TryConvertValue(Nullable.GetUnderlyingType(type)!, value, path, out result, out error);
src\runtime\src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.DependencyInjection (1)
src\runtime\src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.DependencyInjection.Abstractions (1)
src\runtime\src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.Features (1)
FeatureCollection.cs (1)
126if (feature is null && Nullable.GetUnderlyingType(typeof(TFeature)) is null)
Microsoft.Extensions.VectorData.Abstractions (6)
ProviderServices\CollectionModelBuilder.cs (2)
128if ((Nullable.GetUnderlyingType(clrPropertyType) ?? clrPropertyType) != (Nullable.GetUnderlyingType(property.Type) ?? property.Type))
ProviderServices\Filter\FilterTranslatorBase.cs (2)
218var unwrappedPropertyType = Nullable.GetUnderlyingType(propertyModel.Type) ?? propertyModel.Type; 222var convertType = Nullable.GetUnderlyingType(convert.Type) ?? convert.Type;
ProviderServices\PropertyModel.cs (2)
81return Nullable.GetUnderlyingType(Type) is not null; 129if (value is not null && value.GetType() != (Nullable.GetUnderlyingType(propertyType) ?? propertyType))
Microsoft.Extensions.VectorData.Abstractions.Tests (2)
CollectionModelBuilderTests.cs (2)
394if (Nullable.GetUnderlyingType(type) is Type underlyingType) 409if (Nullable.GetUnderlyingType(type) is Type underlyingType)
Microsoft.Extensions.VectorData.ConformanceTests (1)
TypeTests\DataTypeTests.cs (1)
228return Nullable.GetUnderlyingType(property.PropertyType) is not null;
Microsoft.Maui.Controls (5)
BindableProperty.cs (1)
92 if (defaultValue == null && Nullable.GetUnderlyingType(returnType) == null && returnType.IsValueType)
BindingExpressionHelper.cs (2)
15 return !convertTo.GetTypeInfo().IsValueType || Nullable.GetUnderlyingType(convertTo) != null; 29 convertTo = Nullable.GetUnderlyingType(convertTo) ?? convertTo;
Command.cs (1)
53 if (Nullable.GetUnderlyingType(t) != null)
Xaml\TypeConversionExtensions.cs (1)
167 toType = Nullable.GetUnderlyingType(toType);
Microsoft.ML.AutoML (2)
TrainerExtensions\TrainerExtensionUtil.cs (2)
265var propType = Nullable.GetUnderlyingType(fi.FieldType) ?? fi.FieldType; 277if (Nullable.GetUnderlyingType(fi.FieldType) != null)
Microsoft.ML.Data (4)
DataView\DataViewConstructionUtils.cs (2)
254Host.Assert(Nullable.GetUnderlyingType(outputType.GetElementType()) == vectorType.ItemType.RawType); 281Host.Assert(colType.RawType == Nullable.GetUnderlyingType(outputType));
DataView\TypedCursor.cs (2)
374Ch.Assert(colType.GetItemType().RawType == Nullable.GetUnderlyingType(fieldType.GetElementType())); 402Ch.Assert(colType.RawType == Nullable.GetUnderlyingType(fieldType));
Microsoft.Private.Windows.Core (2)
System\Value.cs (2)
764result = Nullable.GetUnderlyingType(typeof(T)) is not null; 904else if (Nullable.GetUnderlyingType(typeof(T)) is Type underlyingType
PresentationFramework (2)
MS\Internal\Data\DefaultValueConverter.cs (2)
115innerType = Nullable.GetUnderlyingType(sourceType); 121innerType = Nullable.GetUnderlyingType(targetType);
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
System.CommandLine (2)
Binding\TypeExtensions.cs (2)
50internal static bool IsNullable(this Type t) => Nullable.GetUnderlyingType(t) is not null; 56nullableType = Nullable.GetUnderlyingType(type);
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (1)
198if (Nullable.GetUnderlyingType(type) != null)
System.ComponentModel.TypeConverter (1)
System\ComponentModel\NullableConverter.cs (1)
28UnderlyingType = Nullable.GetUnderlyingType(type)!;
System.Data.Common (2)
System\Data\DataRowExtensions.cs (2)
166.MakeGenericMethod(Nullable.GetUnderlyingType(typeof(T))!) 193Type nullableType = Nullable.GetUnderlyingType(typeof(T))!;
System.Linq.Expressions (1)
System\Dynamic\DynamicObject.cs (1)
595if (binder.ReturnType.IsValueType && Nullable.GetUnderlyingType(binder.ReturnType) == null)
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (3)
352if (Nullable.GetUnderlyingType(underlyingType) is { } nullableUnderlyingType) 565Type underlyingType = Nullable.GetUnderlyingType(type) ?? type; 600if (!isValueType || (Nullable.GetUnderlyingType(nullability.Type) ?? nullability.Type).IsGenericType)
System\Reflection\Runtime\General\Assignability.cs (1)
54Type? nullableUnderlyingType = Nullable.GetUnderlyingType(toTypeInfo);
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\ReflectionClassWriter.cs (1)
71memberType = Nullable.GetUnderlyingType(memberType)!;
System.Private.Windows.Core (2)
System\Value.cs (2)
764result = Nullable.GetUnderlyingType(typeof(T)) is not null; 904else if (Nullable.GetUnderlyingType(typeof(T)) is Type underlyingType
System.Private.Xml (1)
System\Xml\Serialization\XmlSerializationWriter.cs (1)
1695Type? parameterType = Nullable.GetUnderlyingType(type);
System.Runtime.InteropServices.JavaScript (1)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (1)
204else if (Nullable.GetUnderlyingType(type) is Type ut && ut != null)
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\ObjectManager.cs (1)
391if (Nullable.GetUnderlyingType(type) != null)
System.Text.Json (8)
parent\Common\ReflectionExtensions.cs (1)
311if (Nullable.GetUnderlyingType(parameterType) is Type underlyingType && underlyingType.IsEnum)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
86if (Nullable.GetUnderlyingType(type) is Type underlyingType)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (1)
232Type? underlyingType = Nullable.GetUnderlyingType(typeToConvert);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (2)
412return Nullable.GetUnderlyingType(caseType) is Type underlying && underlying == runtimeType; 520if (Nullable.GetUnderlyingType(parameterType) is not null)
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
708potentialNumberType = Nullable.GetUnderlyingType(potentialNumberType) ?? potentialNumberType;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
1772return Nullable.GetUnderlyingType(type) is null ? JsonTypeInfoKind.Union : JsonTypeInfoKind.None;
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (1)
215Type? nullableUnderlyingType = Nullable.GetUnderlyingType(parameterType);