7 overrides of GetGenericTypeDefinition
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
251public override Type GetGenericTypeDefinition() { return _genericType; }
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
79public override Type GetGenericTypeDefinition() => _unmodifiedType.GetGenericTypeDefinition();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
63public abstract override Type GetGenericTypeDefinition();
System\RuntimeType.NativeAot.cs (1)
422public override Type GetGenericTypeDefinition()
System.Private.Reflection.Execution (1)
Internal\Reflection\Execution\TypeLoader\ConstraintValidatorSupport.cs (1)
83public 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();
497 references to GetGenericTypeDefinition
aspire (1)
Commands\SettingsSchemaBuilder.cs (1)
140.Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IDictionary<,>))
Aspire.Hosting (5)
Ats\CollectionExports.cs (3)
186if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IDictionary<,>)) 191if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>)) 197.FirstOrDefault(static iface => iface.IsGenericType && iface.GetGenericTypeDefinition() == typeof(IDictionary<,>))
ResourceBuilderExtensions.cs (2)
1060&& i.GetGenericTypeDefinition() == typeof(IResourceWithCustomWithReference<>) 4879=> type == typeof(ValueTask) || (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ValueTask<>));
Aspire.Hosting.CodeGeneration.Python (1)
AtsPythonCodeGenerator.cs (1)
2178return DeriveClassName(clrType.GetGenericTypeDefinition()) + "T";
Aspire.Hosting.RemoteHost (21)
Ats\AtsMarshaller.cs (3)
386var genericTypeDefinition = declaredType.GetGenericTypeDefinition(); 602var genericDef = targetType.GetGenericTypeDefinition(); 628var genericDef = targetType.GetGenericTypeDefinition();
Ats\CapabilityDispatcher.cs (1)
657if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
Ats\GenericMethodResolver.cs (2)
76i.GetGenericTypeDefinition() == paramType.GetGenericTypeDefinition());
Ats\PolyglotCapabilityInvocationException.cs (1)
375string.Equals(type.GetGenericTypeDefinition().FullName, HostingTypeNames.ResourceBuilderInterface, StringComparison.Ordinal));
AtsCapabilityScanner.cs (14)
1154var genericTypeDefinition = type.GetGenericTypeDefinition(); 1603var propGenericDef = propType.IsGenericType ? propType.GetGenericTypeDefinition().FullName : null; 2213else if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Task<>)) 2245var genericDef = delegateType.GetGenericTypeDefinition(); 2305else if (funcReturnType.IsGenericType && funcReturnType.GetGenericTypeDefinition() == typeof(Task<>)) 2351if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Task<>)) 2361if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ValueTask<>)) 2408var genericDef = type.GetGenericTypeDefinition(); 2650if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Task<>)) 2661if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ValueTask<>)) 2732var genericDef = type.GetGenericTypeDefinition(); 2933var genericDef = type.GetGenericTypeDefinition(); 3116var genericDef = type.GetGenericTypeDefinition(); 3865var typeDefinitionName = GetXmlDocumentationTypeName(type.GetGenericTypeDefinition());
Aspire.Hosting.Tests (3)
Backchannel\BackchannelContractTests.cs (1)
330var genericDef = type.GetGenericTypeDefinition();
ResourceNotificationTests.cs (1)
1711if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ImmutableArray<>))
WithEndpointTests.cs (1)
194return parameterType.IsGenericType && parameterType.GetGenericTypeDefinition() == typeof(IResourceBuilder<>)
Aspire.TypeSystem (7)
AtsConstants.cs (4)
507var genericDef = type.GetGenericTypeDefinition(); 522var genericDef = type.GetGenericTypeDefinition(); 538var genericDef = type.GetGenericTypeDefinition(); 554var genericDef = type.GetGenericTypeDefinition();
AtsContext.cs (1)
130var genericDef = type.GetGenericTypeDefinition();
HostingTypeHelpers.cs (2)
92string.Equals(type.GetGenericTypeDefinition().FullName, fullName, StringComparison.Ordinal)) 105string.Equals(implementedInterface.GetGenericTypeDefinition().FullName, fullName, StringComparison.Ordinal))
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<>))
ILCompiler.Compiler (2)
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\SortableDependencyNode.cs (2)
187&& x.GetType().GetGenericTypeDefinition() == y.GetType().GetGenericTypeDefinition()));
ILCompiler.ReadyToRun (2)
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\SortableDependencyNode.cs (2)
187&& x.GetType().GetGenericTypeDefinition() == y.GetType().GetGenericTypeDefinition()));
Microsoft.AspNetCore.Components.Endpoints (8)
Forms\ClientValidationCache.cs (1)
189if (interfaceType.IsGenericType && interfaceType.GetGenericTypeDefinition() == typeof(IEnumerable<>))
Rendering\CacheViewTextWriter.cs (1)
171=> value is RenderFragment || (value is Delegate d && d.GetType().IsGenericType && d.GetType().GetGenericTypeDefinition() == typeof(RenderFragment<>));
Rendering\SSRRenderModeBoundary.cs (1)
175if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(RenderFragment<>))
Serialization\JsonStoredDataSerializer.cs (2)
42var definition = type.GetGenericTypeDefinition(); 135return $"{type.GetGenericTypeDefinition().FullName}[{string.Join(',', arguments)}]";
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (2)
206if (d.GetType().IsGenericType && d.GetType().GetGenericTypeDefinition() == typeof(RenderFragment<>)) 391return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(EventCallback<>);
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.Components.Server (2)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (2)
206if (d.GetType().IsGenericType && d.GetType().GetGenericTypeDefinition() == typeof(RenderFragment<>)) 391return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(EventCallback<>);
Microsoft.AspNetCore.Components.Web (1)
JSComponents\JSComponentInterop.cs (1)
170var x when x.IsGenericType && x.GetGenericTypeDefinition() == typeof(EventCallback<>) => ParameterKind.EventCallbackWithSingleParameter,
Microsoft.AspNetCore.Components.WebAssembly (2)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (2)
206if (d.GetType().IsGenericType && d.GetType().GetGenericTypeDefinition() == typeof(RenderFragment<>)) 391return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(EventCallback<>);
Microsoft.AspNetCore.Connections.Abstractions (1)
src\aspnetcore\src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.Http.Abstractions (1)
src\aspnetcore\src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.Http.Extensions (13)
RequestDelegateFactory.cs (4)
542returnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 548returnType.GetGenericTypeDefinition() == typeof(Task<>)) 1123returnType.GetGenericTypeDefinition() == typeof(Task<>)) 1171returnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\aspnetcore\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.Identity.EntityFrameworkCore (1)
IdentityEntityFrameworkBuilderExtensions.cs (1)
100var genericType = type.IsGenericType ? type.GetGenericTypeDefinition() : null;
Microsoft.AspNetCore.JsonPatch (2)
Internal\ConversionResultProvider.cs (1)
86return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.JsonPatch.SystemTextJson (4)
Adapters\AdapterFactory.cs (1)
26if (typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(Dictionary<,>))
Converters\JsonPatchDocumentConverterFactory.cs (1)
15(typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(JsonPatchDocument<>));
Internal\ConversionResultProvider.cs (1)
68return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.Mvc.Abstractions (4)
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\aspnetcore\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)
454(declaredReturnType.GetGenericTypeDefinition() == typeof(Task<>) || declaredReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)))
Microsoft.AspNetCore.Mvc.Core (10)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
144type.GetGenericTypeDefinition() is Type genericDefinition &&
Infrastructure\ActionResultTypeMapper.cs (1)
17returnType.GetGenericTypeDefinition() == typeof(ActionResult<>))
ModelBinding\Binders\CollectionModelBinder.cs (1)
505if (elementType.IsGenericType && elementType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (1)
23modelType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
src\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\aspnetcore\src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
35parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
258declaringType = declaringType.GetGenericTypeDefinition();
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
ViewComponents\DefaultViewComponentDescriptorProvider.cs (1)
87selectedMethod.ReturnType.GetGenericTypeDefinition() != typeof(Task<>))
Microsoft.AspNetCore.OpenApi (12)
Extensions\JsonTypeInfoExtensions.cs (1)
112if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
Extensions\TypeExtensions.cs (2)
62(returnType.GetGenericTypeDefinition() == typeof(Task<>) || returnType.GetGenericTypeDefinition() == typeof(ValueTask<>)))
Services\OpenApiDocumentService.cs (1)
521&& responseType.GetGenericTypeDefinition() == typeof(SseItem<>))
src\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\aspnetcore\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.SignalR.Client.Core (5)
src\aspnetcore\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<>)) 290type.GetGenericTypeDefinition() is Type genericDefinition &&
Internal\HubReflectionHelper.cs (1)
28var baseType = baseDefinition.IsGenericType ? baseDefinition.GetGenericTypeDefinition() : baseDefinition;
src\aspnetcore\src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
63candidate.GetGenericTypeDefinition() == interfaceType;
src\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (2)
64? possibleFSharpAsyncType.GetGenericTypeDefinition() 143(nonGenericAwaitableType, coercerExpression) = genericAwaitableType.GetGenericTypeDefinition() switch
src\aspnetcore\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.Framework (1)
TaskItemTypeDetector.cs (1)
36Type genericTypeDefinition = parameterType.GetGenericTypeDefinition();
Microsoft.CodeAnalysis (1)
TreeDumper.cs (1)
197if (ti.IsGenericType && ti.GetGenericTypeDefinition() == typeof(ImmutableArray<>))
Microsoft.CodeAnalysis.CSharp (1)
Symbols\AssemblySymbol.cs (1)
814var currentTypeInfo = typeInfo.IsGenericType ? typeInfo.GetGenericTypeDefinition().GetTypeInfo() : typeInfo;
Microsoft.CodeAnalysis.ExternalAccess.Extensions (1)
Internal\ExtensionMessageHandlerFactory.cs (1)
56interfaceType.GetGenericTypeDefinition() == unboundInterfaceType)
Microsoft.CodeAnalysis.Scripting (2)
Hosting\CommonMemberFilter.cs (1)
88var genericDef = type.GetTypeInfo().GetGenericTypeDefinition();
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
106if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
Microsoft.CodeAnalysis.Workspaces (1)
Shared\Extensions\TelemetryExtensions.cs (1)
39=> type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : type;
Microsoft.CSharp (21)
Microsoft\CSharp\RuntimeBinder\ComInterop\ComBinderHelpers.cs (1)
45return t.IsGenericType && t.GetGenericTypeDefinition() == typeof(StrongBox<>);
Microsoft\CSharp\RuntimeBinder\ComInterop\TypeUtils.cs (4)
25return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); 58(dest.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IEnumerable<>) 59|| dest.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IList<>) 60|| dest.GetGenericTypeDefinition() == typeof(System.Collections.Generic.ICollection<>))
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)
58callingType = callingType.GetGenericTypeDefinition(); 164type = type.GetGenericTypeDefinition(); 339Type genericDefinition = type.GetGenericTypeDefinition(); 473parentType = parentType.GetGenericTypeDefinition(); 489nextParent = nextParent.GetGenericTypeDefinition(); 802if (agg.AssociatedSystemType.IsEquivalentTo(t.IsGenericType ? t.GetGenericTypeDefinition() : t)) 867agg.AssociatedSystemType = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 954Type genericDefinition = type.GetGenericTypeDefinition(); 974typeName = type.GetGenericTypeDefinition().FullName; 993t = t.GetGenericTypeDefinition(); 1020type = type.GetGenericTypeDefinition(); 1791type = 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.Extensions.AI.Abstractions (8)
Functions\AIFunctionFactory.cs (4)
894t = t.GetGenericTypeDefinition(); 1091if (returnType.GetGenericTypeDefinition() == typeof(Task<>)) 1129if (returnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 1213Debug.Assert(specializedType.IsGenericType && specializedType.GetGenericTypeDefinition() == genericMethodDefinition.DeclaringType, "generic member definition doesn't match type.");
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\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)
Utilities\AIJsonUtilities.Schema.Create.cs (1)
910paramType.GetGenericTypeDefinition().FullName != "Microsoft.FSharp.Core.FSharpOption`1")
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultJsonSerializerFactory.cs (1)
83if (iType.IsGenericType && iType.GetGenericTypeDefinition() == typeof(IEnumerable<>))
Microsoft.Extensions.Configuration.Binder (12)
ConfigurationBinder.cs (11)
457Type? interfaceGenericType = type.IsInterface && type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : null; 749(dictionaryType.GetGenericTypeDefinition() == typeof(IDictionary<,>) || dictionaryType.GetGenericTypeDefinition() == typeof(Dictionary<,>))); 991if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) 1053Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1062Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1069=> type.IsInterface && type.IsConstructedGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>); 1072=> !type.IsValueType || (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)); 1078Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1092actual.GetGenericTypeDefinition() == expected) 1101interfaceType.GetGenericTypeDefinition() == expected)
src\runtime\src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
31parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Extensions.DependencyInjection (7)
ServiceLookup\CallSiteFactory.cs (3)
268serviceType.GetGenericTypeDefinition() != typeof(IEnumerable<>)) 524serviceType.GetGenericTypeDefinition() == descriptorType; 871if (serviceType.IsConstructedGenericType && serviceType.GetGenericTypeDefinition() is Type genericDefinition)
ServiceLookup\ServiceIdentifier.cs (1)
61public ServiceIdentifier GetGenericTypeDefinition() => new ServiceIdentifier(ServiceKey, ServiceType.GetGenericTypeDefinition());
ServiceProvider.cs (2)
121if (!serviceType.IsGenericType || serviceType.GetGenericTypeDefinition() != typeof(IEnumerable<>)) 143if (!serviceType.IsGenericType || serviceType.GetGenericTypeDefinition() != typeof(IEnumerable<>))
src\runtime\src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
31parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Extensions.DependencyInjection.Abstractions (3)
EmptyServiceProvider.cs (2)
100(!serviceType.IsGenericType || serviceType.GetGenericTypeDefinition() != typeof(IEnumerable<>))) 120serviceType.IsConstructedGenericType && serviceType.GetGenericTypeDefinition() == typeof(IEnumerable<>);
src\runtime\src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
31parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Extensions.Options (2)
OptionsServiceCollectionExtensions.cs (2)
179Type gtd = t.GetGenericTypeDefinition(); 202type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Action<>) ?
Microsoft.Extensions.VectorData.Abstractions (3)
ProviderServices\Filter\FilterTranslatorBase.cs (3)
55} when declaringType.GetGenericTypeDefinition() == typeof(List<>): 112} when targetType.GetGenericTypeDefinition() is var gtd 132&& castDeclaringType?.GetGenericTypeDefinition() is var genericTypeDefinition
Microsoft.Extensions.VectorData.ConformanceTests (2)
TestSuiteImplementationTests.cs (2)
59&& baseType.GetGenericTypeDefinition() == interfaceOrBaseType) 66&& type.GetGenericTypeDefinition() == interfaceOrBaseType)
Microsoft.JSInterop (5)
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 (2)
44(!taskType.IsGenericType || taskType.GetGenericTypeDefinition() != typeof(Task<>))) 92: result == null && typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(Nullable<>) // ChangeType can't convert null to value types
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.Private.Windows.Core (4)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
404&& type.GetGenericTypeDefinition() == typeof(List<>) 717&& type.GetGenericTypeDefinition() == typeof(List<>)
System\TypeExtensions.cs (2)
65if (!Matches(type.GetGenericTypeDefinition(), typeName.GetGenericTypeDefinition(), comparison)) 233type.IsGenericType && !type.IsGenericTypeDefinition && type.GetGenericTypeDefinition() == typeof(Nullable<>)
Microsoft.TestPlatform.AdapterUtilities (1)
ManagedNameUtilities\ManagedNameHelper.Reflection.cs (1)
153semanticType = semanticType.GetGenericTypeDefinition();
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)
Mono.Cecil (1)
Mono.Cecil\Import.cs (1)
274 var element_type = ImportType (type.GetGenericTypeDefinition (), context, ImportGenericKind.Definition);
PresentationBuildTasks (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
122return (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Nullable<>)));
PresentationFramework (10)
MS\Internal\Data\PropertyPathWorker.cs (1)
1441type = 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)
1365if (targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(Nullable<>))
System\Windows\Data\BindingExpressionBase.cs (1)
1606if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
System\Windows\Markup\BamlRecordReader.cs (1)
3734return t.IsGenericType && t.GetGenericTypeDefinition() == NullableType;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (1)
695Type genericTypeDefinition = interfaceType.GetGenericTypeDefinition();
System.CommandLine (2)
Argument{T}.cs (1)
120var genericTypeDefinition = typeof(T).GetGenericTypeDefinition();
Binding\ArgumentConverter.DefaultValues.cs (1)
48var genericTypeDefinition = type.GetGenericTypeDefinition();
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
312|| expectedValueType.GetGenericTypeDefinition() != typeof(Nullable<>)))
System\ComponentModel\DataAnnotations\Validator.cs (1)
971destinationType.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)
243string 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)
92if (type.IsGenericType && type.GetGenericTypeDefinition() == baseGenericTypeDefinition) 110return IsGenericDescendentOf(type, baseType.GetGenericTypeDefinition()); 124Type genericType = type.GetGenericTypeDefinition().UnderlyingSystemType;
System.ComponentModel.TypeConverter (2)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
1506if (callingType.IsGenericType && callingType.GetGenericTypeDefinition() == typeof(Nullable<>)) 1567else if (callingType.IsGenericType && callingType.GetGenericTypeDefinition() == typeof(Nullable<>))
System.Composition.Convention (2)
System\Composition\Convention\ConventionBuilder.cs (1)
350iface.GetGenericTypeDefinition() == baseType.AsType())
System\Composition\Convention\ImportConventionBuilder.cs (1)
177(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)
749iFaceTypeInfo.GetGenericTypeDefinition() != typeof(IEnumerable<>))
System\Diagnostics\Metrics\AggregationManager.cs (1)
383genericDefType = type.IsGenericType ? type.GetGenericTypeDefinition() : null;
System.Formats.Nrbf (1)
System\Formats\Nrbf\SerializationRecord.cs (1)
118if (!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 (24)
Internal\Reflection\Augments\ReflectionAugments.cs (1)
125throw new ArgumentException(SR.Format(SR.Argument_MethodDeclaringTypeGeneric, methodBase, methodBase.DeclaringType.GetGenericTypeDefinition()));
Internal\Reflection\Extensions\NonPortable\CustomAttributeSearcher.cs (2)
64if (actualType.IsConstructedGenericType && actualType.GetGenericTypeDefinition() == optionalAttributeTypeFilter) 73if (type.IsConstructedGenericType && type.GetGenericTypeDefinition() == optionalAttributeTypeFilter)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
2139|| (arg == null && (pType.IsValueType && !(pType.IsGenericType && pType.GetGenericTypeDefinition() == typeof(Nullable<>))))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (1)
387return type.IsGenericType && type.GetGenericTypeDefinition() == (Type?)openType;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (3)
358if (type.GetGenericTypeDefinition() != method.DeclaringType) 393if (type.GetGenericTypeDefinition() != constructor.DeclaringType) 426if (type.GetGenericTypeDefinition() != field.DeclaringType)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
79public override Type GetGenericTypeDefinition() => _unmodifiedType.GetGenericTypeDefinition();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (3)
434return type.GetGenericTypeDefinition().GetMemberWithSameMetadataDefinitionAs(member); 530Type contextTypeDefinition = context.IsGenericType && !context.IsGenericTypeDefinition ? context.GetGenericTypeDefinition() : context; 543|| (baseType.IsGenericTypeDefinition ? baseType : baseType.GetGenericTypeDefinition()) != genericParameter.DeclaringType)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureModifiedType.cs (1)
57public override Type GetGenericTypeDefinition() => _unmodifiedType.GetGenericTypeDefinition();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureTypeExtensions.cs (1)
54if (!(pattern.GetGenericTypeDefinition() == actual.GetGenericTypeDefinition()))
System\Delegate.cs (1)
286declaringType = declaringType.GetGenericTypeDefinition();
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (2)
163if (!(t1.GetGenericTypeDefinition().Equals(t2.GetGenericTypeDefinition())))
System\Reflection\Runtime\General\Assignability.cs (5)
45fromTypeInfo = fromTypeInfo.GetGenericTypeDefinition().MakeGenericType(fromTypeInfo.GetGenericTypeParameters()); 195Type genericTypeDefinition = fromTypeInfo.GetGenericTypeDefinition(); 196if (!genericTypeDefinition.Equals(toTypeInfo.GetGenericTypeDefinition())) 358Type toTypeGenericTypeDefinition = toTypeInfo.GetGenericTypeDefinition(); 364Type ifcGenericTypeDefinition = ifc.GetGenericTypeDefinition();
System\Reflection\Runtime\MethodInfos\CustomMethodInvoker.cs (1)
108if (_thisType.IsConstructedGenericType && _thisType.GetGenericTypeDefinition() == typeof(Nullable<>))
System\Reflection\Runtime\MethodInfos\CustomMethodMapper.cs (1)
20bool isNullable = declaringType.IsConstructedGenericType && declaringType.GetGenericTypeDefinition() == typeof(Nullable<>);
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<>)); 1346xmlName = DataContract.GetXmlName(type.GetGenericTypeDefinition());
System\Runtime\Serialization\CollectionDataContract.cs (6)
877&& interfaceType.GetGenericTypeDefinition() == Globals.TypeOfIEnumeratorGeneric 928type = type.GetGenericTypeDefinition(); 1004return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1053Type interfaceTypeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 1135Type interfaceTypeToCheck = interfaceType.IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1369Type typeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type;
System\Runtime\Serialization\DataContract.cs (5)
1189while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1199while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1952type.GetGenericTypeDefinition() == Globals.TypeOfNullable); 2050collectionDataContract.ItemType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue) 2303: this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments())
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
573if (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.Reflection.Execution (8)
Internal\Reflection\Execution\TypeLoader\ConstraintValidatorSupport.cs (2)
85return _underlyingType.GetGenericTypeDefinition(); 248return type.IsGenericType && typeof(Nullable<>) == type.GetGenericTypeDefinition();
Internal\Reflection\Execution\TypeLoader\TypeCast.cs (6)
53Type pTargetGenericType = pTargetType.GetGenericTypeDefinition(); 69if (!pInterfaceType.GetGenericTypeDefinition().Equals(pTargetGenericType)) 115Type pTargetGenericType = pTargetType.GetGenericTypeDefinition(); 116Type pSourceGenericType = pSourceType.GetGenericTypeDefinition(); 387if (!pType1.GetGenericTypeDefinition().Equals(pType2.GetGenericTypeDefinition()))
System.Private.Windows.Core (4)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
404&& type.GetGenericTypeDefinition() == typeof(List<>) 717&& type.GetGenericTypeDefinition() == typeof(List<>)
System\TypeExtensions.cs (2)
65if (!Matches(type.GetGenericTypeDefinition(), typeName.GetGenericTypeDefinition(), comparison)) 233type.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)
1014return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1021if (type.GetGenericTypeDefinition() == typeof(Nullable<>).GetGenericTypeDefinition())
System\Xml\Serialization\XmlReflectionImporter.cs (1)
980Type 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)
827declaringType.GetGenericTypeDefinition() is not TypeBuilderImpl && 830return declaringType.GetGenericTypeDefinition().GetMemberWithSameMetadataDefinitionAs(memberInfo); 1097return (type.GetGenericTypeDefinition() is TypeBuilderImpl tb && Equals(tb.Module)) ||
System\Reflection\Emit\SignatureHelper.cs (1)
191module.GetTypeHandle(type.GetGenericTypeDefinition()), genericArguments.Length, type.IsValueType);
System\Reflection\Emit\TypeBuilderImpl.cs (2)
203(_typeParent.GetGenericTypeDefinition() is TypeBuilderImpl || _module.ContainsTypeBuilder(_typeParent.GetGenericArguments()))) 206con = 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.InteropServices.JavaScript (2)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (2)
328else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ArraySegment<>)) 332else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Span<>))
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)
95type.GetGenericTypeDefinition() == typeof(Nullable<>));
System.ServiceModel.NetTcp (1)
System\ServiceModel\Channels\TcpChannelFactory.cs (1)
108if (other.GetType().GetGenericTypeDefinition() != typeof(TcpChannelFactory<>))
System.ServiceModel.Primitives (5)
System\ServiceModel\Description\ServiceReflector.cs (2)
892if (method.ReturnType.IsGenericType() && method.ReturnType.GetGenericTypeDefinition() == taskTResultType) 909if (methodReturnType.IsGenericType() && methodReturnType.GetGenericTypeDefinition() == taskTResultType)
System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
562type.GetGenericTypeDefinition() == s_typeOfIQueryableGeneric)
System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
53if (faultType.IsGenericType() && (faultType.GetGenericTypeDefinition() == typeof(FaultException<>)))
System\ServiceModel\MessageHeaderT.cs (1)
87if (headerParameterType.IsGenericType() && headerParameterType.GetGenericTypeDefinition() == typeof(MessageHeader<>))
System.ServiceModel.UnixDomainSocket (1)
System\ServiceModel\Channels\UnixDomainSocketChannelFactory.cs (1)
121if (other.GetType().GetGenericTypeDefinition() != typeof(UnixDomainSocketChannelFactory<>))
System.Text.Json (24)
src\runtime\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 (6)
23type.IsGenericType && type.GetGenericTypeDefinition() == s_nullableType; 187if (iface.IsGenericType && iface.GetGenericTypeDefinition() == baseTypeDefinition) 202if (current.IsGenericType && current.GetGenericTypeDefinition() == baseTypeDefinition) 291if (!target.IsGenericType || pattern.GetGenericTypeDefinition() != target.GetGenericTypeDefinition()) 581type.IsGenericType && !type.IsGenericTypeDefinition ? type.GetGenericTypeDefinition() : type;
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (2)
20Type typeDef = typeToConvert.GetGenericTypeDefinition(); 28Type converterType = typeToConvert.GetGenericTypeDefinition() == typeof(Memory<>) ?
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
226baseTypeDefinition ??= baseType.GetGenericTypeDefinition();
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (8)
158Type genericType = type.GetGenericTypeDefinition(); 247Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 256Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 266Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 275Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 284Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 292Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 300Debug.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.Windows.Forms.Design (1)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
85&& collectionItemType.GetGenericTypeDefinition().Name.StartsWith("ControlProxy", StringComparison.Ordinal))
System.Xaml (5)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
122return (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Nullable<>)));
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1459Type openGeneric = type.GetGenericTypeDefinition();
System\Xaml\Schema\CollectionReflector.cs (2)
282if (type.IsGenericType && type.GetGenericTypeDefinition() == interfaceType) 289if (currentInterface.IsGenericType && currentInterface.GetGenericTypeDefinition() == interfaceType)
System\Xaml\XamlObjectReader.cs (1)
1286parameterInfo.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>)))