142 references to Nullable
aspire (1)
Commands\SettingsSchemaBuilder.cs (1)
65var underlyingType = Nullable.GetUnderlyingType(type) ?? type;
Aspire.Hosting (4)
Ats\AtsCapabilityScanner.cs (4)
1493var isNullable = Nullable.GetUnderlyingType(paramType) != null; 1728var underlyingType = Nullable.GetUnderlyingType(type); 1968var underlyingType = Nullable.GetUnderlyingType(type); 2408var underlyingType = Nullable.GetUnderlyingType(type);
Aspire.Hosting.Tests (1)
Backchannel\BackchannelContractTests.cs (1)
115? Nullable.GetUnderlyingType(prop.PropertyType) is not null
aspire-server (2)
Ats\AtsMarshaller.cs (2)
116if (Nullable.GetUnderlyingType(type) is { } underlying) 455var underlyingType = Nullable.GetUnderlyingType(targetType) ?? targetType;
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
3871Type parameterType = Nullable.GetUnderlyingType(type);
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
illink (1)
ILLink.RoslynAnalyzer (1)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (1)
352/// <see cref="System.Nullable.GetUnderlyingType(System.Type)"/>
Metrics (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Metrics.Legacy (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.AspNetCore.Components (3)
BindConverter.cs (2)
1791else if (typeof(T).IsEnum || Nullable.GetUnderlyingType(typeof(T)) is Type { IsEnum: true } innerType) 2004else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum)
NavigationManagerExtensions.cs (1)
719var underlyingParameterValueType = Nullable.GetUnderlyingType(parameterValueType) ?? parameterValueType;
Microsoft.AspNetCore.Components.Endpoints (4)
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 &&
src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\PropertyColumn.cs (1)
55var nullableUnderlyingTypeOrNull = Nullable.GetUnderlyingType(typeof(TProp));
Microsoft.AspNetCore.Components.Web (3)
Forms\InputBase.cs (1)
277_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\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.AspNetCore.Http.Abstractions (2)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Http.Extensions (9)
RequestDelegateFactory.cs (3)
1574var isNullable = Nullable.GetUnderlyingType(parameterType) != null || 1690var underlyingNullableType = Nullable.GetUnderlyingType(targetParseType); 1992var underlyingType = Nullable.GetUnderlyingType(parameterType);
src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (2)
17var underlyingType = Nullable.GetUnderlyingType(type); 25var underlyingType = Nullable.GetUnderlyingType(type);
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (1)
82(Nullable.GetUnderlyingType(type) is { } underlyingType &&
src\Shared\ParameterBindingMethodCache.cs (2)
69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType;
src\Shared\PropertyAsParameterInfo.cs (1)
98var 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 (6)
ModelBinding\Metadata\ModelBindingMessageProvider.cs (1)
36/// non-<see cref="Nullable"/> property.
ModelBinding\ModelMetadata.cs (3)
652modelType = Nullable.GetUnderlyingType(modelType) ?? modelType; 751IsNullableValueType = Nullable.GetUnderlyingType(ModelType) != null; 753UnderlyingOrModelType = Nullable.GetUnderlyingType(ModelType) ?? ModelType;
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\Shared\PropertyAsParameterInfo.cs (1)
98var 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\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Mvc.Core.Test (6)
ApplicationModels\ActionModelTest.cs (1)
121Nullable.GetUnderlyingType(property.PropertyType) != null)
ApplicationModels\AttributeRouteModelTests.cs (1)
39Nullable.GetUnderlyingType(property.PropertyType) != null)
ApplicationModels\ControllerModelTest.cs (1)
123Nullable.GetUnderlyingType(property.PropertyType) != null)
ApplicationModels\ParameterModelTest.cs (1)
57Nullable.GetUnderlyingType(property.PropertyType) != null)
ApplicationModels\PropertyModelTest.cs (1)
53Nullable.GetUnderlyingType(property.PropertyType) != null)
ModelBinding\Binders\EnumTypeModelBinderTest.cs (1)
260var underlyingType = Nullable.GetUnderlyingType(modelType);
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 (6)
Extensions\JsonNodeSchemaExtensions.cs (1)
211var underlyingType = Nullable.GetUnderlyingType(type);
Extensions\JsonTypeInfoExtensions.cs (1)
56var underlyingType = Nullable.GetUnderlyingType(type);
Services\OpenApiDocumentService.cs (1)
788? Nullable.GetUnderlyingType(parameter.Type) ?? parameter.Type
src\Shared\ParameterBindingMethodCache.cs (2)
69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType;
src\Shared\PropertyAsParameterInfo.cs (1)
98var isNullable = Nullable.GetUnderlyingType(parameters[i].ParameterType) != null ||
Microsoft.AspNetCore.Routing (1)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Routing.Abstractions (1)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
498type = Nullable.GetUnderlyingType(type) ?? type;
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Options\OptionSerializerTests.cs (1)
99var enumType = Nullable.GetUnderlyingType(type);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Options\GlobalOptionsTests.cs (1)
133var propertyType = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType;
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Protocol\Converters\SumConverter.cs (1)
122return Nullable.GetUnderlyingType(sumTypeType) ?? sumTypeType;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (2)
296else if (Nullable.GetUnderlyingType(type)?.IsEnum == true) 299var enumType = Nullable.GetUnderlyingType(type)!;
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
126_ when Nullable.GetUnderlyingType(type) is { IsEnum: true } underlying => value is null ? Enum.ToObject(underlying, 1) : null,
Microsoft.Extensions.AI.Abstractions (3)
Utilities\AIJsonUtilities.Schema.Create.cs (3)
329if (Nullable.GetUnderlyingType(ctx.TypeInfo.Type) is Type nullableElement) 865return parameterType.IsValueType && Nullable.GetUnderlyingType(parameterType) is null 881if (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)
609instance = Activator.CreateInstance(Nullable.GetUnderlyingType(type) ?? type); 987return TryConvertValue(Nullable.GetUnderlyingType(type)!, value, path, out result, out error);
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.DependencyInjection (1)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.DependencyInjection.Abstractions (1)
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.Validation (1)
RuntimeValidatableParameterInfoResolver.cs (1)
106if (Nullable.GetUnderlyingType(type) is { } nullableType)
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.VisualStudio.LanguageServices (2)
Options\VisualStudioSettingsOptionPersister.cs (2)
90var underlyingType = Nullable.GetUnderlyingType(storageType); 206if (type.IsEnum || Nullable.GetUnderlyingType(type)?.IsEnum == true)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
375[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Nullable))]
netstandard (1)
netstandard.cs (1)
1328[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Nullable))]
PresentationFramework (2)
MS\Internal\Data\DefaultValueConverter.cs (2)
115innerType = Nullable.GetUnderlyingType(sourceType); 121innerType = Nullable.GetUnderlyingType(targetType);
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Roslyn.VisualStudio.Next.UnitTests (2)
UnifiedSettings\UnifiedSettingsTests.cs (2)
312var underlyingType = Nullable.GetUnderlyingType(type); 365var nonNullableType = Nullable.GetUnderlyingType(type) ?? 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 (5)
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)
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
196destType = Nullable.GetUnderlyingType(destType) ?? destType;
src\System\RuntimeType.ActivatorCache.cs (1)
80Debug.Assert(Nullable.GetUnderlyingType(rt) != null,
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 (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
369[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Nullable))]
System.Runtime.InteropServices (1)
System\Runtime\InteropServices\Marshalling\ComInterfaceMarshaller.cs (1)
79if (Marshal.QueryInterface(unknown, in Nullable.GetValueRefOrDefaultRef(in TargetInterfaceIID), out nint interfacePointer) != 0)
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\ObjectManager.cs (1)
391if (Nullable.GetUnderlyingType(type) != null)
System.Text.Json (4)
src\libraries\System.Text.Json\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)
204Type? underlyingType = Nullable.GetUnderlyingType(typeToConvert);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
713potentialNumberType = Nullable.GetUnderlyingType(potentialNumberType) ?? potentialNumberType;
Test.Utilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
98Nullable.GetUnderlyingType(type)?.IsEnum == true ||