8 overrides of GetGenericTypeDefinition
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
252public override Type GetGenericTypeDefinition() { return _genericType; }
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
79public override Type GetGenericTypeDefinition() => _unmodifiedType.GetGenericTypeDefinition();
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
59public abstract override Type GetGenericTypeDefinition();
src\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs (1)
196public override Type GetGenericTypeDefinition() { throw new InvalidOperationException(); }
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
1062public override Type GetGenericTypeDefinition() { if (IsGenericTypeDefinition) return this; if (m_genTypeDef == null) throw new InvalidOperationException(); return m_genTypeDef; }
src\System\RuntimeType.CoreCLR.cs (1)
3525public override Type GetGenericTypeDefinition()
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
230public override Type GetGenericTypeDefinition()
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
90public abstract override Type GetGenericTypeDefinition();
427 references to GetGenericTypeDefinition
BuildActionTelemetryTable (1)
src\Workspaces\Core\Portable\Shared\Extensions\TelemetryExtensions.cs (1)
39=> type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : type;
dotnet-svcutil-lib (29)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (1)
802Type genType = type.GetGenericTypeDefinition();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (3)
999return t.GetTypeInfo().IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1006if (type.GetGenericTypeDefinition() == typeof(Nullable<>).GetGenericTypeDefinition())
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (1)
970Type genType = type.GetGenericTypeDefinition();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (3)
398return t.GetTypeInfo().IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 481type = type.GetGenericTypeDefinition(); 1350if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePairAdapter)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (5)
901type = type.GetGenericTypeDefinition(); 990return t.GetTypeInfo().IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1027Type interfaceTypeToCheck = type.GetTypeInfo().IsGenericType ? type.GetGenericTypeDefinition() : type; 1100Type interfaceTypeToCheck = interfaceType.GetTypeInfo().IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1278Type typeToCheck = type.GetTypeInfo().IsGenericType ? type.GetGenericTypeDefinition() : type;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (6)
791if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePair) 1329while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1339while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 2055type.GetGenericTypeDefinition() == Globals.TypeOfNullable); 2142collectionDataContract.ItemType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue) 2347: this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments())
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (1)
384while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (4)
148else if (objType.GetTypeInfo().IsGenericType && objType.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePairAdapter) 399&& interfaceType.GetGenericTypeDefinition() == Globals.TypeOfIEnumeratorGeneric 555memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable); 640while (memberType.GetTypeInfo().IsGenericType && memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (2)
855if (method.ReturnType.IsGenericType() && method.ReturnType.GetGenericTypeDefinition() == taskTResultType) 872if (methodReturnType.IsGenericType() && methodReturnType.GetGenericTypeDefinition() == taskTResultType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
460type.GetGenericTypeDefinition() == s_typeOfIQueryableGeneric)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
46if (faultType.IsGenericType() && (faultType.GetGenericTypeDefinition() == typeof(FaultException<>)))
FrameworkFork\System.ServiceModel\System\ServiceModel\MessageHeaderT.cs (1)
101if (headerParameterType.IsGenericType() && headerParameterType.GetGenericTypeDefinition() == typeof(MessageHeader<>))
Microsoft.Arcade.Test.Common (1)
AssertEx.cs (1)
31(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.AspNetCore.App.Analyzers.Test (5)
RouteEmbeddedLanguage\Infrastructure\ExportProviderExtensions.cs (5)
65if (contractType.GetGenericTypeDefinition() == typeof(IList<>) 66|| contractType.GetGenericTypeDefinition() == typeof(ICollection<>) 67|| contractType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) 75if (contractType.GetGenericTypeDefinition() == typeof(Lazy<>)) 79else if (contractType.GetGenericTypeDefinition() == typeof(Lazy<,>))
Microsoft.AspNetCore.Components.Endpoints (2)
Rendering\SSRRenderModeBoundary.cs (1)
126if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(RenderFragment<>))
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.Components.Web (1)
JSComponents\JSComponentInterop.cs (1)
170var x when x.IsGenericType && x.GetGenericTypeDefinition() == typeof(EventCallback<>) => ParameterKind.EventCallbackWithSingleParameter,
Microsoft.AspNetCore.Connections.Abstractions (1)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.Http.Abstractions (1)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.Http.Extensions (13)
RequestDelegateFactory.cs (4)
533returnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 539returnType.GetGenericTypeDefinition() == typeof(Task<>)) 1111returnType.GetGenericTypeDefinition() == typeof(Task<>)) 1159returnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
406if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 421if (currentType.IsGenericType && currentType.GetGenericTypeDefinition() == typeof(Task<>)) 489if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\Shared\ParameterBindingMethodCache.cs (3)
263valueTaskResultType.GetGenericTypeDefinition() == typeof(Nullable<>) && 309methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>); 415if (i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IBindableFromHttpContext<>) && i.GetGenericArguments()[0] == type)
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
341f.FieldType.GetGenericTypeDefinition() == typeof(FeatureReferences<>));
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
IdentityEntityFrameworkBuilderExtensions.cs (1)
99var genericType = type.IsGenericType ? type.GetGenericTypeDefinition() : null;
Microsoft.AspNetCore.JsonPatch (2)
Internal\ConversionResultProvider.cs (1)
86return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.Mvc.Abstractions (4)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\Shared\ParameterBindingMethodCache.cs (3)
263valueTaskResultType.GetGenericTypeDefinition() == typeof(Nullable<>) && 309methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>); 415if (i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IBindableFromHttpContext<>) && i.GetGenericArguments()[0] == type)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (2)
360(declaredReturnType.GetGenericTypeDefinition() == typeof(Task<>) || declaredReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)))
Microsoft.AspNetCore.Mvc.Core (9)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
144type.GetGenericTypeDefinition() is Type genericDefinition &&
Infrastructure\ActionResultTypeMapper.cs (1)
17returnType.GetGenericTypeDefinition() == typeof(ActionResult<>))
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (1)
23modelType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
406if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 421if (currentType.IsGenericType && currentType.GetGenericTypeDefinition() == typeof(Task<>)) 489if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageCreateTagHelperTest.cs (1)
83serviceType.IsGenericType && serviceType.GetGenericTypeDefinition() == typeof(IEnumerable<>))))
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
ViewComponents\DefaultViewComponentDescriptorProvider.cs (1)
87selectedMethod.ReturnType.GetGenericTypeDefinition() != typeof(Task<>))
Microsoft.AspNetCore.OpenApi (8)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
406if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 421if (currentType.IsGenericType && currentType.GetGenericTypeDefinition() == typeof(Task<>)) 489if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\Shared\ParameterBindingMethodCache.cs (3)
263valueTaskResultType.GetGenericTypeDefinition() == typeof(Nullable<>) && 309methodInfo.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>); 415if (i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IBindableFromHttpContext<>) && i.GetGenericArguments()[0] == type)
Microsoft.AspNetCore.Shared.Tests (7)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
406if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 421if (currentType.IsGenericType && currentType.GetGenericTypeDefinition() == typeof(Task<>)) 489if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.SignalR.Client.Core (5)
src\SignalR\common\Shared\ReflectionHelper.cs (5)
33if (nullableType.IsGenericType && nullableType.GetGenericTypeDefinition() == typeof(ChannelReader<>)) 57if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IAsyncEnumerable<>)) 64if (typeToCheck.IsGenericType && typeToCheck.GetGenericTypeDefinition() == typeof(IAsyncEnumerable<>)) 80if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IAsyncEnumerator<>)) 87if (typeToCheck.IsGenericType && typeToCheck.GetGenericTypeDefinition() == typeof(IAsyncEnumerator<>))
Microsoft.AspNetCore.SignalR.Core (14)
Internal\HubMethodDescriptor.cs (2)
51if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(ChannelReader<>)) 286type.GetGenericTypeDefinition() is Type genericDefinition &&
Internal\HubReflectionHelper.cs (1)
28var baseType = baseDefinition.IsGenericType ? baseDefinition.GetGenericTypeDefinition() : baseDefinition;
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
406if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 421if (currentType.IsGenericType && currentType.GetGenericTypeDefinition() == typeof(Task<>)) 489if (methodReturnType.IsGenericType && methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\SignalR\common\Shared\ReflectionHelper.cs (5)
33if (nullableType.IsGenericType && nullableType.GetGenericTypeDefinition() == typeof(ChannelReader<>)) 57if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IAsyncEnumerable<>)) 64if (typeToCheck.IsGenericType && typeToCheck.GetGenericTypeDefinition() == typeof(IAsyncEnumerable<>)) 80if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IAsyncEnumerator<>)) 87if (typeToCheck.IsGenericType && typeToCheck.GetGenericTypeDefinition() == typeof(IAsyncEnumerator<>))
Microsoft.Build.BuildCheck.UnitTests (1)
EditorConfig_Tests.cs (1)
29(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.Build.Engine.UnitTests (1)
BackEnd\TranslationHelpers.cs (1)
159if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
Microsoft.CodeAnalysis (1)
TreeDumper.cs (1)
190if (ti.IsGenericType && ti.GetGenericTypeDefinition() == typeof(ImmutableArray<>))
Microsoft.CodeAnalysis.CSharp (1)
Symbols\AssemblySymbol.cs (1)
787var currentTypeInfo = typeInfo.IsGenericType ? typeInfo.GetGenericTypeDefinition().GetTypeInfo() : typeInfo;
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\MemberInfo\TypeImpl.cs (1)
179return (TypeImpl)this.Type.GetGenericTypeDefinition();
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Protocol\Extensions\Converters\VSExtensionUtilities.cs (2)
49(existingConverterType.GetGenericTypeDefinition() == typeof(VSExtensionConverter<,>) || existingConverterType.GetGenericTypeDefinition() == typeof(VSExtensionConverter<,>)) &&
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (2)
62(existingConverterType.GetGenericTypeDefinition() == typeof(VSExtensionConverter<,>) || existingConverterType.GetGenericTypeDefinition() == typeof(VSExtensionConverter<,>)) &&
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\MethodHandlerDetails.cs (1)
68var genericDefinition = interfaceType.GetGenericTypeDefinition();
Microsoft.CodeAnalysis.Scripting (2)
Hosting\CommonMemberFilter.cs (1)
88var genericDef = type.GetTypeInfo().GetGenericTypeDefinition();
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
108if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
Microsoft.CodeAnalysis.Test.Utilities (1)
Assert\AssertEx.cs (1)
47(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.CodeAnalysis.UnitTests (2)
Collections\List\SegmentedList.Generic.Tests.AddRange.cs (2)
69if (firstParameter.ParameterType.GetGenericTypeDefinition() != typeof(SegmentedList<>)) 72if (spanParameter.ParameterType.GetGenericTypeDefinition() != typeof(ReadOnlySpan<>))
Microsoft.CodeAnalysis.Workspaces (1)
Shared\Extensions\TelemetryExtensions.cs (1)
39=> type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : type;
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Remote\ServiceDescriptorTests.cs (3)
89type.GetGenericTypeDefinition() == typeof(Nullable<>) || 121if (method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 326formatterType.GetGenericTypeDefinition() == typeof(ForceTypelessFormatter<>) &&
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
MethodHandlerDetails.cs (1)
68var genericDefinition = interfaceType.GetGenericTypeDefinition();
Microsoft.CSharp (16)
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (3)
16return type.IsConstructedGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); 128Type t1def = t1.IsConstructedGenericType ? t1.GetGenericTypeDefinition() : t1; 129Type t2def = t2.IsConstructedGenericType ? t2.GetGenericTypeDefinition() : t2;
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (1)
166Type genType = sysType.GetGenericTypeDefinition();
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (12)
57callingType = callingType.GetGenericTypeDefinition(); 159type = type.GetGenericTypeDefinition(); 331Type genericDefinition = type.GetGenericTypeDefinition(); 464parentType = parentType.GetGenericTypeDefinition(); 480nextParent = nextParent.GetGenericTypeDefinition(); 786if (agg.AssociatedSystemType.IsEquivalentTo(t.IsGenericType ? t.GetGenericTypeDefinition() : t)) 847agg.AssociatedSystemType = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 934Type genericDefinition = type.GetGenericTypeDefinition(); 954typeName = type.GetGenericTypeDefinition().FullName; 973t = t.GetGenericTypeDefinition(); 999type = type.GetGenericTypeDefinition(); 1756type = type.GetGenericTypeDefinition();
Microsoft.DotNet.Internal.DependencyInjection.Testing (4)
DependencyInjectionValidation.cs (4)
209Type parameterRoot = parameterType.GetGenericTypeDefinition(); 219Type serviceRoot = serviceType.GetGenericTypeDefinition(); 232Type def = parameterType.GetGenericTypeDefinition(); 258return IsExemptType(type.GetGenericTypeDefinition());
Microsoft.DotNet.NuGetRepack.Tests (1)
TestHelpers\AssertEx.cs (1)
31(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (2)
HelperFactory.cs (2)
224m.GetParameters()[1].ParameterType.GetGenericTypeDefinition() == typeof(Func<,>)) 284(output.IsConstructedGenericType && output.GetGenericTypeDefinition() == typeof(Nullable<>)))
Microsoft.Extensions.AI (4)
Functions\AIFunctionFactory.cs (4)
234t = t.GetGenericTypeDefinition(); 466if (returnType.GetGenericTypeDefinition() == typeof(Task<>)) 478if (returnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 526Debug.Assert(specializedType.IsGenericType && specializedType.GetGenericTypeDefinition() == genericMethodDefinition.DeclaringType, "generic member definition doesn't match type.");
Microsoft.Extensions.AI.Abstractions (3)
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (3)
432return NullabilityInfoHelpers.GetMemberWithSameMetadataDefinitionAs(type.GetGenericTypeDefinition(), member); 520Type contextTypeDefinition = context.IsGenericType && !context.IsGenericTypeDefinition ? context.GetGenericTypeDefinition() : context; 533|| (baseType.IsGenericTypeDefinition ? baseType : baseType.GetGenericTypeDefinition()) != genericParameter.DeclaringType)
Microsoft.Extensions.Configuration.Binder (10)
ConfigurationBinder.cs (9)
428Type? interfaceGenericType = type.IsInterface && type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : null; 700(dictionaryType.GetGenericTypeDefinition() == typeof(IDictionary<,>) || dictionaryType.GetGenericTypeDefinition() == typeof(Dictionary<,>))); 943if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) 1000Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1009Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1019Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1033actual.GetGenericTypeDefinition() == expected) 1042interfaceType.GetGenericTypeDefinition() == expected)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
31parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Extensions.DependencyInjection (5)
ServiceLookup\CallSiteFactory.cs (3)
268serviceType.GetGenericTypeDefinition() != typeof(IEnumerable<>)) 420serviceIdentifier.ServiceType.GetGenericTypeDefinition() == descriptor.ServiceType) 681if (serviceType.IsConstructedGenericType && serviceType.GetGenericTypeDefinition() is Type genericDefinition)
ServiceLookup\ServiceIdentifier.cs (1)
63public ServiceIdentifier GetGenericTypeDefinition() => new ServiceIdentifier(ServiceKey, ServiceType.GetGenericTypeDefinition());
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
31parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Extensions.DependencyInjection.Abstractions (1)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
31parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Extensions.Options (2)
OptionsServiceCollectionExtensions.cs (2)
177Type gtd = t.GetGenericTypeDefinition(); 200type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Action<>) ?
Microsoft.JSInterop (4)
Infrastructure\DotNetDispatcher.cs (2)
126&& syncResultType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 275return !parameterType.IsGenericType || parameterType.GetGenericTypeDefinition() != typeof(DotNetObjectReference<>);
Infrastructure\DotNetObjectReferenceJsonConverterFactory.cs (1)
21return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(DotNetObjectReference<>);
Infrastructure\TaskGenericsUtil.cs (1)
44(!taskType.IsGenericType || taskType.GetGenericTypeDefinition() != typeof(Task<>)))
Microsoft.Maui (1)
HotReload\HotReloadHelper.cs (1)
183 newType = pair.Value.GetGenericTypeDefinition().MakeGenericType(newHandler);
Microsoft.Maui.Controls (4)
BindableProperty.cs (1)
213 return !returnType.IsValueType || returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Nullable<>);
BindingExpression.cs (1)
422 Type genericTypeDefinition = propertyType.GetGenericTypeDefinition();
TypeConversionHelper.cs (1)
24 return !targetType.IsValueType || targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(Nullable<>);
Xaml\TypeConversionExtensions.cs (1)
166 if (toType.IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
Microsoft.Maui.Controls.Xaml (1)
ApplyPropertiesVisitor.cs (1)
610 property.ReturnType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.ML.Core (7)
CommandLine\CmdParser.cs (1)
1103return type.IsConstructedGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
EntryPoints\EntryPointUtils.cs (2)
69if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Optional<>) && fieldVal == null) 75if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Optional<>))
EntryPoints\ModuleArgs.cs (3)
606if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Optional<>) || type.GetGenericTypeDefinition() == typeof(Nullable<>))) 633if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>)
Utilities\PlatformUtils.cs (1)
30return info.IsGenericType && info.GetGenericTypeDefinition() == typeDef;
Microsoft.ML.Data (33)
DataView\DataViewConstructionUtils.cs (6)
253if (outputType.GetElementType().IsGenericType && outputType.GetElementType().GetGenericTypeDefinition() == typeof(Nullable<>)) 265Host.Assert(outputType.GetGenericTypeDefinition() == typeof(VBuffer<>)); 280if (outputType.IsGenericType && outputType.GetGenericTypeDefinition() == typeof(Nullable<>)) 918Contracts.Check(typeof(TDst).IsGenericType && typeof(TDst).GetGenericTypeDefinition() == typeof(VBuffer<>)); 943Contracts.Assert(typeT.GetGenericTypeDefinition() == typeof(VBuffer<>)); 944Contracts.Check(typeof(TDst).GetGenericTypeDefinition() == typeof(VBuffer<>));
DataView\InternalSchemaDefinition.cs (1)
169else if (rawType.IsGenericType && rawType.GetGenericTypeDefinition() == typeof(VBuffer<>))
DataView\TypedCursor.cs (3)
373if (fieldType.GetElementType().IsGenericType && fieldType.GetElementType().GetGenericTypeDefinition() == typeof(Nullable<>)) 385Ch.Assert(fieldType.GetGenericTypeDefinition() == typeof(VBuffer<>)); 401if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Nullable<>))
EntryPoints\EntryPointNode.cs (3)
72if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>) 184if (variableType.IsGenericType && variableType.GetGenericTypeDefinition() == typeof(Optional<>)) 205Contracts.Assert(variableType.IsGenericType && variableType.GetGenericTypeDefinition() == typeof(Dictionary<,>)
EntryPoints\InputBuilder.cs (18)
129(type.GetGenericTypeDefinition() == typeof(Optional<>) || 130type.GetGenericTypeDefinition() == typeof(Var<>) || 131type.GetGenericTypeDefinition() == typeof(Nullable<>))) 277if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Optional<>)) 287((type.GetGenericTypeDefinition() == typeof(Var<>)) || 288type.GetGenericTypeDefinition() == typeof(ArrayVar<>) || 289type.GetGenericTypeDefinition() == typeof(DictionaryVar<>))) 338else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>) && 357if (deftype.IsGenericType && deftype.GetGenericTypeDefinition() == typeof(Optional<>)) 393Contracts.Assert(type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Optional<>)); 413if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Optional<>) || type.GetGenericTypeDefinition() == typeof(Nullable<>))) 415if (type.GetGenericTypeDefinition() == typeof(Optional<>) && value.HasValues) 420if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Var<>))) 623var genericType = outerType.GetGenericTypeDefinition(); 630bool isOptional = outerType.GetGenericTypeDefinition() == typeof(Optional<>); 670if (outputType.IsGenericType && outputType.GetGenericTypeDefinition() == typeof(CommonOutputs.MacroOutput<>)) 708if (type != null && type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Var<>)))
Utils\ApiUtils.cs (2)
39(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(VBuffer<>)) || 40(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) ||
Microsoft.ML.EntryPoints (9)
JsonUtils\JsonManifestUtils.cs (9)
73if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Var<>)) 92if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Optional<>) || type.GetGenericTypeDefinition() == typeof(Nullable<>))) 181jo[FieldNames.IsNullable] = fieldInfo.FieldType.IsGenericType && (fieldInfo.FieldType.GetGenericTypeDefinition() == typeof(Nullable<>)); 189fieldInfo.FieldType.GetGenericTypeDefinition() == typeof(Optional<>)) 287if (outputType.IsGenericType && outputType.GetGenericTypeDefinition() == typeof(CommonOutputs.MacroOutput<>)) 327if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Var<>)) 404if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(Nullable<>)) 408if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(Optional<>))
Microsoft.ML.Predictor.Tests (1)
CmdLine\CmdLine.cs (1)
306if (type.IsConstructedGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
Microsoft.ML.Transforms (1)
PermutationFeatureImportanceExtensions.cs (1)
728if (iType.IsGenericType && iType.GetGenericTypeDefinition() == typeof(IPredictionTransformer<>))
Microsoft.VisualBasic.Core (12)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2637TargetType.GetGenericTypeDefinition().Equals(GetType(Nullable(Of ))) AndAlso
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (8)
1014Dim rawGenericParameterType As Type = parameterType.GetGenericTypeDefinition 1045argumentType.GetGenericTypeDefinition Is rawGenericParameterType) Then 1062base.GetGenericTypeDefinition Is rawGenericParameterType) Then 1077implemented.GetGenericTypeDefinition Is rawGenericParameterType) Then 1148argumentType.GetGenericTypeDefinition Is parameterType.GetGenericTypeDefinition Then 1155possibleGenericType.GetGenericTypeDefinition Is parameterType.GetGenericTypeDefinition Then
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
517Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type")
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
247Dim t1def As Type = If(t1.IsConstructedGenericType, t1.GetGenericTypeDefinition(), t1) 248Dim t2def As Type = If(t2.IsConstructedGenericType, t2.GetGenericTypeDefinition(), t2)
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
123return (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Nullable<>)));
PresentationCore (2)
System\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
298if (!type.IsGenericType || type.GetGenericTypeDefinition() != typeof(List<>)) 580&& type.GetGenericTypeDefinition() == typeof(List<>)
PresentationFramework (10)
MS\Internal\Data\PropertyPathWorker.cs (1)
1440type = type.GetGenericTypeDefinition();
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (1)
1006else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Collections.Generic.KeyValuePair<,>))
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (4)
44return CustomTypeToHelperTypeMappings.TryGetValue(publicType.GetGenericTypeDefinition(), out Type abiTypeDefinition) 63return CustomAbiTypeToTypeMappings.TryGetValue(abiType.GetGenericTypeDefinition(), out Type publicTypeDefinition) 115if(IsTypeWindowsRuntimeTypeNoArray(type.GetGenericTypeDefinition())) 144var definition = type.GetGenericTypeDefinition();
System\Windows\Data\BindingExpression.cs (1)
1366if (targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(Nullable<>))
System\Windows\Data\BindingExpressionBase.cs (1)
1613if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
System\Windows\Markup\BamlRecordReader.cs (1)
3741return t.IsGenericType && t.GetGenericTypeDefinition() == NullableType;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (1)
696Type genericTypeDefinition = interfaceType.GetGenericTypeDefinition();
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
312|| expectedValueType.GetGenericTypeDefinition() != typeof(Nullable<>)))
System\ComponentModel\DataAnnotations\Validator.cs (1)
362destinationType.GetGenericTypeDefinition() == typeof(Nullable<>));
System.ComponentModel.Composition (10)
Microsoft\Internal\Collections\CollectionServices.cs (1)
24Type genericType = type.GetGenericTypeDefinition().UnderlyingSystemType;
Microsoft\Internal\ReflectionServices.cs (2)
95instanceType.UnderlyingSystemType.GetGenericTypeDefinition() == targetOpenInterfaceType.UnderlyingSystemType) 109targetInterface.UnderlyingSystemType.GetGenericTypeDefinition() == targetOpenInterfaceType.UnderlyingSystemType)
System\ComponentModel\Composition\ContractNameServices.cs (1)
251string genericTypeName = FindGenericTypeName(type.GetGenericTypeDefinition().Name);
System\ComponentModel\Composition\Hosting\CompositionServices.cs (2)
85return specifiedContractType.GetGenericTypeDefinition().MakeGenericType(memberGenericParameters.ToArray()); 510metadata[CompositionConstants.GenericContractMetadataName] = ContractNameServices.GetTypeIdentity(type.GetGenericTypeDefinition());
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (1)
131return type.GetGenericTypeDefinition().MakeGenericType(subSpecialization);
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (3)
100if (type.IsGenericType && type.GetGenericTypeDefinition() == baseGenericTypeDefinition) 118return IsGenericDescendentOf(type, baseType.GetGenericTypeDefinition()); 132Type genericType = type.GetGenericTypeDefinition().UnderlyingSystemType;
System.ComponentModel.TypeConverter (2)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
1513if (callingType.IsGenericType && callingType.GetGenericTypeDefinition() == typeof(Nullable<>)) 1574else if (callingType.IsGenericType && callingType.GetGenericTypeDefinition() == typeof(Nullable<>))
System.Composition.Convention (2)
System\Composition\Convention\ConventionBuilder.cs (1)
368iface.GetGenericTypeDefinition() == baseType.AsType())
System\Composition\Convention\ImportConventionBuilder.cs (1)
192(typeInfo.AsType().IsConstructedGenericType && s_supportedImportManyTypes.Contains(typeInfo.GetGenericTypeDefinition()));
System.Composition.Hosting (5)
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryExportDescriptorProvider.cs (1)
18if (!exportKey.ContractType.IsConstructedGenericType || exportKey.ContractType.GetGenericTypeDefinition() != typeof(ExportFactory<>))
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryWithMetadataExportDescriptorProvider.cs (1)
20if (!contract.ContractType.IsConstructedGenericType || contract.ContractType.GetGenericTypeDefinition() != typeof(ExportFactory<,>))
System\Composition\Hosting\Providers\ImportMany\ImportManyExportDescriptorProvider.cs (1)
20contract.ContractType.IsConstructedGenericType && s_supportedContractTypes.Contains(contract.ContractType.GetGenericTypeDefinition())))
System\Composition\Hosting\Providers\Lazy\LazyExportDescriptorProvider.cs (1)
19if (!exportKey.ContractType.IsConstructedGenericType || exportKey.ContractType.GetGenericTypeDefinition() != typeof(Lazy<>))
System\Composition\Hosting\Providers\Lazy\LazyWithMetadataExportDescriptorProvider.cs (1)
19if (!exportKey.ContractType.IsConstructedGenericType || exportKey.ContractType.GetGenericTypeDefinition() != typeof(Lazy<,>))
System.Composition.TypedParts (3)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
138Type genericPartType = type.GetGenericTypeDefinition();
System\Composition\TypedParts\Discovery\TypeInspector.cs (1)
190if (ifce == contractType || (ifce.IsGenericType && ifce.GetGenericTypeDefinition() == contractType.AsType()))
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (1)
109var gtd = contract.ContractType.GetGenericTypeDefinition();
System.Data.Common (2)
System\Data\Common\DataStorage.cs (1)
525return ((StorageType.Empty == typeCode) && dataType.IsGenericType && (dataType.GetGenericTypeDefinition() == typeof(System.Nullable<>)));
System\Data\TypeLimiter.cs (1)
292if (type.IsGenericType && !type.IsGenericTypeDefinition && type.GetGenericTypeDefinition() == typeof(List<>))
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\DsesFilterAndTransform.cs (1)
733iFaceTypeInfo.GetGenericTypeDefinition() != typeof(IEnumerable<>))
System\Diagnostics\Metrics\AggregationManager.cs (1)
310genericDefType = type.IsGenericType ? type.GetGenericTypeDefinition() : null;
System.Formats.Nrbf (1)
System\Formats\Nrbf\SerializationRecord.cs (1)
123if (!Matches(type.GetGenericTypeDefinition(), typeName.GetGenericTypeDefinition()))
System.Linq.Expressions (8)
System\Dynamic\Utils\TypeUtils.cs (7)
17.Select(i => i.GetGenericTypeDefinition()) 100public static bool IsNullableType(this Type type) => type.IsConstructedGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); 453Type destGen = dest.GetGenericTypeDefinition(); 480Type sourceGen = source.GetGenericTypeDefinition(); 536Type genericDelegate = source.GetGenericTypeDefinition(); 538if (dest.GetGenericTypeDefinition() != genericDelegate) 872if (type.IsConstructedGenericType && AreEquivalent(type.GetGenericTypeDefinition(), definition))
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
616Debug.Assert(siteType.IsGenericType && siteType.GetGenericTypeDefinition() == typeof(CallSite<>));
System.Linq.Queryable (5)
System\Linq\EnumerableRewriter.cs (4)
129if (t.IsGenericType && t.GetGenericTypeDefinition().GetInterfaces().Contains(typeof(IGrouping<,>))) 135if (iType.IsGenericType && iType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) 162Type genericType = pubType.GetGenericTypeDefinition(); 177.Select(i => new { Info = i, GenType = i.GetGenericTypeDefinition() })
System\Linq\TypeHelper.cs (1)
21if (type.IsGenericType && type.GetGenericTypeDefinition() == definition)
System.Private.CoreLib (21)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DiagnosticMethodInfo.cs (1)
35declaringType = declaringType.GetGenericTypeDefinition();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
2124|| (arg == null && (pType.IsValueType && !(pType.IsGenericType && pType.GetGenericTypeDefinition() == typeof(Nullable<>))))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (1)
390return type.IsGenericType && type.GetGenericTypeDefinition() == (Type?)openType;
src\libraries\System.Private.CoreLib\src\System\Nullable.cs (1)
110Type genericType = nullableType.GetGenericTypeDefinition();
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (3)
351if (type.GetGenericTypeDefinition() != method.DeclaringType) 386if (type.GetGenericTypeDefinition() != constructor.DeclaringType) 419if (type.GetGenericTypeDefinition() != field.DeclaringType)
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
79public override Type GetGenericTypeDefinition() => _unmodifiedType.GetGenericTypeDefinition();
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (3)
446return type.GetGenericTypeDefinition().GetMemberWithSameMetadataDefinitionAs(member); 542Type contextTypeDefinition = context.IsGenericType && !context.IsGenericTypeDefinition ? context.GetGenericTypeDefinition() : context; 555|| (baseType.IsGenericTypeDefinition ? baseType : baseType.GetGenericTypeDefinition()) != genericParameter.DeclaringType)
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureTypeExtensions.cs (1)
54if (!(pattern.GetGenericTypeDefinition() == actual.GetGenericTypeDefinition()))
src\System\Collections\Generic\ComparerHelpers.cs (2)
40else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) 78else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
src\System\Delegate.CoreCLR.cs (1)
192currentType.GetGenericTypeDefinition() == targetType)
src\System\Reflection\Emit\DynamicILGenerator.cs (1)
1016Type t = m.DeclaringType!.GetGenericTypeDefinition();
src\System\Reflection\Emit\RuntimeFieldBuilder.cs (1)
146if (!(m_fieldType.IsGenericType && m_fieldType.GetGenericTypeDefinition() == typeof(Nullable<>)))
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
1250Type? genericTypeDefinition = m_typeParent.GetGenericTypeDefinition();
src\System\Reflection\Emit\SignatureHelper.cs (1)
337AddOneArgTypeHelperWorker(clsArgument.GetGenericTypeDefinition(), true);
src\System\Reflection\FieldInfo.CoreCLR.cs (1)
19f.Name, declaringType.GetGenericTypeDefinition()));
src\System\Reflection\MethodBase.CoreCLR.cs (1)
26m, declaringType.GetGenericTypeDefinition()));
System.Private.DataContractSerialization (33)
System\Runtime\Serialization\AccessorBuilder.cs (2)
49if (declaringType.IsGenericType && declaringType.GetGenericTypeDefinition() == typeof(KeyValue<,>)) 106if (declaringType.IsGenericType && declaringType.GetGenericTypeDefinition() == typeof(KeyValue<,>))
System\Runtime\Serialization\ClassDataContract.cs (2)
290return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1344xmlName = DataContract.GetXmlName(type.GetGenericTypeDefinition());
System\Runtime\Serialization\CollectionDataContract.cs (6)
877&& interfaceType.GetGenericTypeDefinition() == Globals.TypeOfIEnumeratorGeneric 928type = type.GetGenericTypeDefinition(); 1002return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1051Type interfaceTypeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 1133Type interfaceTypeToCheck = interfaceType.IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1366Type typeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type;
System\Runtime\Serialization\DataContract.cs (5)
1164while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1174while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1927type.GetGenericTypeDefinition() == Globals.TypeOfNullable); 2025collectionDataContract.ItemType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue) 2276: this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments())
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
564if (itemType.IsGenericType && (itemType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue))
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
296&& collectionDataContract.ItemType.GetGenericTypeDefinition() == typeof(KeyValue<,>))
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (2)
472while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 734while (keyType.IsGenericType && keyType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
400&& interfaceType.GetGenericTypeDefinition() == Globals.TypeOfIEnumeratorGeneric 636memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable); 725while (memberType.IsGenericType && memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (1)
154while (keyType.IsGenericType && keyType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (2)
360(oldItemContract.UnderlyingType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue)) 413&& collectionContract.ItemType.GetGenericTypeDefinition() == typeof(KeyValue<,>))
System\Runtime\Serialization\ReflectionClassWriter.cs (1)
50bool originValueIsNullableOfT = (memberType.IsGenericType && memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable);
System\Runtime\Serialization\ReflectionReader.cs (2)
253while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 348while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System\Runtime\Serialization\SchemaExporter.cs (1)
284clrType = clrType.GetGenericTypeDefinition();
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (1)
509while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (3)
479&& interfaceType.GetGenericTypeDefinition() == Globals.TypeOfIEnumeratorGeneric 649memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable); 738while (memberType.IsGenericType && memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System.Private.Windows.Core (4)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
405&& type.GetGenericTypeDefinition() == typeof(List<>) 718&& type.GetGenericTypeDefinition() == typeof(List<>)
System\TypeExtensions.cs (2)
103if (!MatchLessAssemblyVersion(type.GetGenericTypeDefinition(), typeName.GetGenericTypeDefinition())) 278type.IsGenericType && !type.IsGenericTypeDefinition && type.GetGenericTypeDefinition() == typeof(Nullable<>)
System.Private.Xml (5)
System\Xml\Serialization\SoapReflectionImporter.cs (1)
780Type genType = type.GetGenericTypeDefinition();
System\Xml\Serialization\Types.cs (3)
951return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 958if (type.GetGenericTypeDefinition() == typeof(Nullable<>).GetGenericTypeDefinition())
System\Xml\Serialization\XmlReflectionImporter.cs (1)
975Type genType = type.GetGenericTypeDefinition();
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
232return _typeInfo.GetGenericTypeDefinition();
System.Reflection.Emit (6)
System\Reflection\Emit\ModuleBuilderImpl.cs (3)
819declaringType.GetGenericTypeDefinition() is not TypeBuilderImpl && 822return declaringType.GetGenericTypeDefinition().GetMemberWithSameMetadataDefinitionAs(memberInfo); 1106return (type.GetGenericTypeDefinition() is TypeBuilderImpl tb && Equals(tb.Module)) ||
System\Reflection\Emit\SignatureHelper.cs (1)
199module.GetTypeHandle(type.GetGenericTypeDefinition()), genericArguments.Length, type.IsValueType);
System\Reflection\Emit\TypeBuilderImpl.cs (2)
215(_typeParent.GetGenericTypeDefinition() is TypeBuilderImpl || _module.ContainsTypeBuilder(_typeParent.GetGenericArguments()))) 218con = GetConstructor(_typeParent, _typeParent.GetGenericTypeDefinition().GetConstructor(
System.Reflection.MetadataLoadContext (11)
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (2)
156if (!(t1.GetGenericTypeDefinition().Equals(t2.GetGenericTypeDefinition())))
System\Reflection\Runtime\SignatureTypeExtensions.cs (3)
57if (!(pattern.GetGenericTypeDefinition() == actual.GetGenericTypeDefinition())) 150return signatureType.GetGenericTypeDefinition().TryMakeGenericType(newGenericTypeArguments!);
System\Reflection\TypeLoading\General\Assignability.cs (6)
36fromTypeInfo = fromTypeInfo.GetGenericTypeDefinition().MakeGenericType(fromTypeInfo.GetGenericTypeParameters()); 45if (toTypeInfo.IsConstructedGenericType && toTypeInfo.GetGenericTypeDefinition() == coreTypes[CoreType.NullableT]) 193Type genericTypeDefinition = fromTypeInfo.GetGenericTypeDefinition(); 194if (!genericTypeDefinition.Equals(toTypeInfo.GetGenericTypeDefinition())) 345Type toTypeGenericTypeDefinition = toTypeInfo.GetGenericTypeDefinition(); 351Type ifcGenericTypeDefinition = ifc.GetGenericTypeDefinition();
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\FormatterServices.cs (1)
358var builder = new StringBuilder(type.GetGenericTypeDefinition().FullName).Append('[');
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\SchemaImportHelper.cs (1)
63type.GetGenericTypeDefinition() == typeof(Nullable<>));
System.ServiceModel.UnixDomainSocket (1)
System\ServiceModel\Channels\UnixDomainSocketChannelFactory.cs (1)
121if (other.GetType().GetGenericTypeDefinition() != typeof(UnixDomainSocketChannelFactory<>))
System.Text.Json (20)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (7)
51Debug.Assert(baseType == baseType.GetGenericTypeDefinition()); 59Type genericTypeToCheck = baseTypeToCheck.GetGenericTypeDefinition(); 88Debug.Assert(interfaceType == interfaceType.GetGenericTypeDefinition()); 94interfaceToCheck = interfaceToCheck.GetGenericTypeDefinition(); 106Type genericInterfaceToCheck = typeToCheck.GetGenericTypeDefinition(); 215Type genericTypeDef = genericType.GetGenericTypeDefinition(); 225=> type.IsGenericType && type.GetGenericTypeDefinition() == typeof(KeyValuePair<,>);
System\ReflectionExtensions.cs (3)
22type.IsGenericType && type.GetGenericTypeDefinition() == s_nullableType; 138return type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : type; 147Type genericTypeDef = member.DeclaringType.GetGenericTypeDefinition();
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (2)
20Type typeDef = typeToConvert.GetGenericTypeDefinition(); 28Type converterType = typeToConvert.GetGenericTypeDefinition() == typeof(Memory<>) ?
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (8)
129Type genericType = type.GetGenericTypeDefinition(); 149Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 158Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 168Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 177Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 186Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 194Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 202Debug.Assert(typeof(TFSharpMap).GetGenericTypeDefinition() == _fsharpMapType);
System.Windows.Forms (3)
System\Windows\Forms\DataBinding\ListBindingHelper.cs (2)
504if (typeof(IList<>).IsAssignableFrom(type.GetGenericTypeDefinition())) 515if (typeof(IList<>).IsAssignableFrom(curInterface.GetGenericTypeDefinition()))
System\Windows\Forms\Internal\Formatter.cs (1)
504if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
System.Xaml (5)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
123return (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Nullable<>)));
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1460Type openGeneric = type.GetGenericTypeDefinition();
System\Xaml\Schema\CollectionReflector.cs (2)
283if (type.IsGenericType && type.GetGenericTypeDefinition() == interfaceType) 290if (currentInterface.IsGenericType && currentInterface.GetGenericTypeDefinition() == interfaceType)
System\Xaml\XamlObjectReader.cs (1)
1287parameterInfo.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>)))
xunit.assert (9)
Assert.cs (2)
56 /// Safely perform <see cref="Type.GetGenericTypeDefinition"/>, returning <c>null</c> when the 81 return type.GetGenericTypeDefinition();
EqualityAsserts.cs (2)
320 var expectedInterfaceTypeDefinitions = expectedType?.GetTypeInfo().ImplementedInterfaces.Where(i => i.GetTypeInfo().IsGenericType).Select(i => i.GetGenericTypeDefinition()); 323 var actualInterfaceTypeDefinitions = actualType?.GetTypeInfo().ImplementedInterfaces.Where(i => i.GetTypeInfo().IsGenericType).Select(i => i.GetGenericTypeDefinition());
Sdk\ArgumentFormatter.cs (4)
510 var shortTypeInfo = typeInfo.IsGenericType ? typeInfo.GetGenericTypeDefinition().GetTypeInfo() : typeInfo; 529 if (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>)) 545 if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) 589 let genericTypeDefinition = @interface.GetGenericTypeDefinition()
Sdk\AssertEqualityComparer.cs (1)
322 typeof(T).GetGenericTypeDefinition() == typeKeyValuePair)