8 overrides of IsGenericType
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
233public override bool IsGenericType => true;
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
80public override bool IsGenericType => _unmodifiedType.IsGenericType;
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
30public sealed override bool IsGenericType => IsGenericTypeDefinition || IsConstructedGenericType;
src\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs (1)
182public override bool IsGenericType => false;
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
1056public override bool IsGenericType => m_inst != null;
src\System\RuntimeType.CoreCLR.cs (1)
3501public override unsafe bool IsGenericType
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
87public override bool IsGenericType
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
100public sealed override bool IsGenericType => IsConstructedGenericType || IsGenericTypeDefinition;
451 references to IsGenericType
dotnet-svcutil-lib (35)
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (1)
117if (info.IsGenericType && !info.ContainsGenericParameters)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifier.cs (1)
231Type[] arguments = info.IsGenericType || info.ContainsGenericParameters ? t.GetGenericArguments() : new Type[0];
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (1)
800if (type.GetTypeInfo().IsGenericType && typeName.IndexOf('{') >= 0)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (3)
999return t.GetTypeInfo().IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1004if (type.GetTypeInfo().IsGenericType) 1027else if (t.GetTypeInfo().IsGenericType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (1)
968if (type.GetTypeInfo().IsGenericType && typeName.IndexOf('{') >= 0)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
200if (info.IsGenericType || info.ContainsGenericParameters && DynamicAssemblies.IsTypeDynamic(type.GetGenericArguments()))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (2)
246if (info.IsGenericType || info.ContainsGenericParameters) 453if (info.IsGenericType || info.ContainsGenericParameters)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
3732else if (info.IsGenericType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (3)
398return t.GetTypeInfo().IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 479if (type.GetTypeInfo().IsGenericType && !type.GetTypeInfo().IsGenericTypeDefinition) 1350if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePairAdapter)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (7)
900if (type.GetTypeInfo().IsGenericType) 990return t.GetTypeInfo().IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1027Type interfaceTypeToCheck = type.GetTypeInfo().IsGenericType ? type.GetGenericTypeDefinition() : type; 1034if (type.GetTypeInfo().IsGenericType) 1100Type interfaceTypeToCheck = interfaceType.GetTypeInfo().IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1130itemType = knownInterfaceType.GetTypeInfo().IsGenericType ? knownInterfaceType.GetGenericArguments()[0] : Globals.TypeOfObject; 1278Type typeToCheck = type.GetTypeInfo().IsGenericType ? type.GetGenericTypeDefinition() : type;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (7)
791if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePair) 1329while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1339while (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1453if (type.GetTypeInfo().IsGenericType && !type.GetTypeInfo().IsGenericTypeDefinition) 1593if (type.GetTypeInfo().IsGenericType && !type.GetTypeInfo().IsGenericTypeDefinition) 1680if (type.GetTypeInfo().IsGenericType) 2054(type.GetTypeInfo().IsGenericType &&
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) 398if (interfaceType.GetTypeInfo().IsGenericType 554bool isNullableOfT = (memberType.GetTypeInfo().IsGenericType && 640while (memberType.GetTypeInfo().IsGenericType && memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
FrameworkFork\System.ServiceModel\Extensions\ReflectionExtensions.cs (1)
64return type.GetTypeInfo().IsGenericType;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (1)
52if (t.GetTypeInfo().IsGenericType)
InMemory.FunctionalTests (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.Arcade.Test.Common (1)
AssertEx.cs (1)
31(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.AspNetCore.Components.Endpoints (2)
Rendering\SSRRenderModeBoundary.cs (1)
126if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(RenderFragment<>))
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
62candidate.IsGenericType &&
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)
34bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.AspNetCore.Hosting (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.AspNetCore.Http.Abstractions (1)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
34bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
Microsoft.AspNetCore.Http.Extensions (15)
RequestDelegateFactory.cs (5)
532else if (returnType.IsGenericType && 538else if (returnType.IsGenericType && 622if (constructorType.IsGenericType) 1110else if (returnType.IsGenericType && 1158else if (returnType.IsGenericType &&
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
62candidate.IsGenericType &&
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)
63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 136if (!genericAwaitableType.IsGenericType)
src\Shared\ParameterBindingMethodCache.cs (3)
262else if (valueTaskResultType.IsGenericType && 308return methodInfo.ReturnType.IsGenericType && 415if (i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IBindableFromHttpContext<>) && i.GetGenericArguments()[0] == type)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
340f.FieldType.GetTypeInfo().IsGenericType &&
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)
62candidate.IsGenericType &&
Microsoft.AspNetCore.Mvc.Abstractions (5)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
62candidate.IsGenericType &&
src\Shared\ParameterBindingMethodCache.cs (3)
262else if (valueTaskResultType.IsGenericType && 308return methodInfo.ReturnType.IsGenericType && 415if (i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IBindableFromHttpContext<>) && i.GetGenericArguments()[0] == type)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
359if (declaredReturnType.IsGenericType &&
Microsoft.AspNetCore.Mvc.Core (8)
Infrastructure\ActionResultTypeMapper.cs (1)
16if (returnType.IsGenericType &&
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (1)
22if (modelType.IsGenericType &&
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)
63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 136if (!genericAwaitableType.IsGenericType)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
34bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
EnumerableWrapperProviderFactory.cs (1)
45if (declaredType != null && declaredType.IsInterface && declaredType.IsGenericType)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
BsonTempDataSerializer.cs (1)
177else if (typeToSerialize.IsGenericType)
NewtonsoftJsonPatchInputFormatter.cs (1)
87!modelType.IsGenericType)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
62candidate.IsGenericType &&
Microsoft.AspNetCore.Mvc.Razor (1)
TagHelpers\TagHelperFeatureProvider.cs (1)
52!type.IsGenericType;
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageCreateTagHelperTest.cs (1)
83serviceType.IsGenericType && serviceType.GetGenericTypeDefinition() == typeof(IEnumerable<>))))
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
ViewComponents\DefaultViewComponentDescriptorProvider.cs (1)
86if (!selectedMethod.ReturnType.IsGenericType ||
Microsoft.AspNetCore.OpenApi (10)
Extensions\JsonTypeInfoExtensions.cs (1)
105if (type.IsGenericType)
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)
63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 136if (!genericAwaitableType.IsGenericType)
src\Shared\ParameterBindingMethodCache.cs (3)
262else if (valueTaskResultType.IsGenericType && 308return methodInfo.ReturnType.IsGenericType && 415if (i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IBindableFromHttpContext<>) && i.GetGenericArguments()[0] == type)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
Microsoft.AspNetCore.Shared.Tests (8)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
62candidate.IsGenericType &&
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)
63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 136if (!genericAwaitableType.IsGenericType)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
34bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
61if (type.IsGenericType)
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 (13)
Internal\HubMethodDescriptor.cs (1)
51if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(ChannelReader<>))
Internal\HubReflectionHelper.cs (1)
28var baseType = baseDefinition.IsGenericType ? baseDefinition.GetGenericTypeDefinition() : baseDefinition;
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (1)
62candidate.IsGenericType &&
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)
63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 136if (!genericAwaitableType.IsGenericType)
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 (2)
Symbols\AssemblySymbol.cs (2)
787var currentTypeInfo = typeInfo.IsGenericType ? typeInfo.GetGenericTypeDefinition().GetTypeInfo() : typeInfo; 791Debug.Assert(currentTypeInfo.IsGenericTypeDefinition || !currentTypeInfo.IsGenericType);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
482if (!(expType.GetTypeInfo().IsGenericType))
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\MemberInfo\TypeImpl.cs (1)
280get { return Type.IsGenericType; }
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
48if (existingConverterType.IsGenericType &&
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
61if (existingConverterType.IsGenericType &&
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\MethodHandlerDetails.cs (1)
63if (!interfaceType.IsGenericType)
Microsoft.CodeAnalysis.Scripting (4)
Hosting\CommonMemberFilter.cs (1)
86if (type?.GetTypeInfo().IsGenericType == true)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (2)
108if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) 718if (!type.IsGenericType)
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (1)
57if (typeInfo.IsGenericType)
Microsoft.CodeAnalysis.Test.Utilities (1)
Assert\AssertEx.cs (1)
47(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestInfo.cs (1)
53Assert.False(type.IsGenericType, "Option should not be defined in a generic type");
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Remote\ServiceDescriptorTests.cs (3)
84if (type.IsGenericType) 121if (method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>)) 325formatter => formatter.GetType() is { IsGenericType: true } and var formatterType &&
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
MethodHandlerDetails.cs (1)
63if (!interfaceType.IsGenericType)
Microsoft.CSharp (23)
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (2)
434if (!t.IsGenericType && !t.IsNested) 440if (t.IsGenericType)
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (2)
182if (t1.IsGenericType && t2.IsGenericType)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (2)
42if (!type.IsGenericType && !type.IsNested) 113if (!type.IsGenericType && !type.IsNested)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (1)
41if (!type.IsGenericType && !type.IsNested)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (2)
164if (sysType.IsGenericType) 313if (uninstantiatedType.IsGenericType)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (14)
55if (callingType.IsGenericType) 157if (type.IsGenericType) 281if (type.IsGenericType) 329if (type.IsGenericType) 462if (parentType != null && parentType.IsGenericType) 478if (nextParent != null && nextParent.IsGenericType) 669if (type.IsGenericType) 786if (agg.AssociatedSystemType.IsEquivalentTo(t.IsGenericType ? t.GetGenericTypeDefinition() : t)) 847agg.AssociatedSystemType = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 932if (type.IsGenericType) 952if (type.IsGenericType) 971if (t.IsGenericType) 997if (type.IsGenericType) 1754if (type.IsGenericType)
Microsoft.DotNet.NuGetRepack.Tests (1)
TestHelpers\AssertEx.cs (1)
31(type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
Microsoft.Extensions.AI (3)
Functions\AIFunctionFactory.cs (3)
232if (t.IsGenericType) 463if (returnType.IsGenericType) 526Debug.Assert(specializedType.IsGenericType && specializedType.GetGenericTypeDefinition() == genericMethodDefinition.DeclaringType, "generic member definition doesn't match type.");
Microsoft.Extensions.AI.Abstractions (7)
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (7)
360if (underlyingType.IsGenericType) 379if (underlyingType.IsGenericType) 430if ((type != null) && type.IsGenericType && !type.IsGenericTypeDefinition) 520Type contextTypeDefinition = context.IsGenericType && !context.IsGenericTypeDefinition ? context.GetGenericTypeDefinition() : context; 532if (!baseType.IsGenericType 557if (underlyingType.IsGenericType) 594if (!isValueType || (Nullable.GetUnderlyingType(nullability.Type) ?? nullability.Type).IsGenericType)
Microsoft.Extensions.Configuration.Binder (5)
ConfigurationBinder.cs (4)
699Debug.Assert(dictionaryType.IsGenericType && 943if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) 1032if (actual.IsGenericType && 1041if (interfaceType.IsGenericType &&
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
30bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
Microsoft.Extensions.DependencyInjection (4)
DependencyInjectionEventSource.cs (1)
209if (descriptor.ServiceType.IsGenericType)
ServiceProvider.cs (1)
188if (descriptor.ServiceType.IsGenericType && !descriptor.ServiceType.IsConstructedGenericType)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
30bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
59if (type.IsGenericType)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
30bool isNullableParameterType = parameter.ParameterType.IsGenericType &&
Microsoft.Extensions.Diagnostics.Abstractions (1)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
59if (type.IsGenericType)
Microsoft.Extensions.Http (1)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
59if (type.IsGenericType)
Microsoft.Extensions.Logging.Abstractions (1)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
59if (type.IsGenericType)
Microsoft.Extensions.Options (2)
OptionsServiceCollectionExtensions.cs (2)
175if (t.IsGenericType) 200type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Action<>) ?
Microsoft.JSInterop (5)
Infrastructure\DotNetDispatcher.cs (2)
125else if (syncResult?.GetType() is { IsGenericType: true } syncResultType 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<>))) 50return taskType.IsGenericType
Microsoft.Maui (2)
Handlers\HybridWebView\HybridWebViewHandler.cs (1)
278 if (dotnetMethod.ReturnType.IsGenericType)
HotReload\HotReloadHelper.cs (1)
182 if (pair.Value.IsGenericType)
Microsoft.Maui.Controls (4)
BindableProperty.cs (1)
213 return !returnType.IsValueType || returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Nullable<>);
BindingExpression.cs (1)
420 if (part.NextPart != null && propertyType.IsGenericType && propertyType.IsValueType)
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)
609 var nullable = property.ReturnType.IsGenericType &&
Microsoft.ML.Core (7)
CommandLine\CmdParser.cs (2)
1267bool isGeneric = type.IsGenericType; 2308!factoryType.IsGenericType)
EntryPoints\EntryPointUtils.cs (2)
69if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Optional<>) && fieldVal == null) 75if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Optional<>))
EntryPoints\ModuleArgs.cs (2)
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 (27)
DataView\DataViewConstructionUtils.cs (6)
253if (outputType.GetElementType().IsGenericType && outputType.GetElementType().GetGenericTypeDefinition() == typeof(Nullable<>)) 264Host.Assert(outputType.IsGenericType); 280if (outputType.IsGenericType && outputType.GetGenericTypeDefinition() == typeof(Nullable<>)) 918Contracts.Check(typeof(TDst).IsGenericType && typeof(TDst).GetGenericTypeDefinition() == typeof(VBuffer<>)); 941Contracts.Assert(typeT.IsGenericType); 942Contracts.Check(typeof(TDst).IsGenericType);
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<>)) 384Ch.Assert(fieldType.IsGenericType); 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 (11)
128if (type.IsGenericType && 277if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Optional<>)) 286else if (type.IsGenericType && 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<>))) 420if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Var<>))) 620if (!outerType.IsGenericType) 670if (outputType.IsGenericType && outputType.GetGenericTypeDefinition() == typeof(CommonOutputs.MacroOutput<>)) 708if (type != null && type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(Var<>)))
Scorers\PredictionTransformer.cs (1)
830if (att.LoadType.IsGenericType && att.LoadType.GetGenericArguments().Length == modelType.GetGenericArguments().Length)
Utils\ApiUtils.cs (2)
39(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(VBuffer<>)) || 40(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) ||
Microsoft.ML.EntryPoints (8)
JsonUtils\JsonManifestUtils.cs (8)
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<>)); 188if (fieldInfo.FieldType.IsGenericType && 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.Parquet (1)
ParquetLoader.cs (1)
763if (enu.Current is IList && enu.Current.GetType().IsGenericType)
Microsoft.ML.Transforms (1)
PermutationFeatureImportanceExtensions.cs (1)
728if (iType.IsGenericType && iType.GetGenericTypeDefinition() == typeof(IPredictionTransformer<>))
Microsoft.VisualBasic.Core (7)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2635(TargetType.IsGenericType AndAlso
Microsoft\VisualBasic\CompilerServices\Symbols.vb (2)
482Return type.IsGenericType 486Return type.IsGenericType AndAlso (Not type.IsGenericTypeDefinition)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (2)
467If Not typ.IsGenericType Then 475If typ.DeclaringType IsNot Nothing AndAlso typ.DeclaringType.IsGenericType Then
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
294If t1.IsGenericType AndAlso t2.IsGenericType Then
Microsoft.VisualStudio.LanguageServices (1)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (1)
109else if (declaringType?.IsGenericType == true)
PresentationBuildTasks (7)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (5)
2303if (genericName.Length > 0 || t.IsGenericType) 2348if (t.IsGenericType) 2377if (refType == null || !refType.IsGenericType || !refType.IsGenericTypeDefinition || typeArgsList == null) 2462Debug.Assert(_typeArgsList == null || (baseClass.IsGenericType && baseClass.IsGenericTypeDefinition)); 2463Debug.Assert(_typeArgsList != null || !baseClass.IsGenericType);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
776string fullName = owner.IsGenericType ? $"{owner.Namespace}.{owner.Name}" : owner.FullName;
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<>)) 579return type.IsGenericType
PresentationFramework (15)
MS\Internal\Data\PropertyPathWorker.cs (1)
1438if (type.IsGenericType)
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (3)
21if (!type.IsGenericType) 45if (type.IsGenericType) 133if (!type.IsGenericType)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (1)
1006else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Collections.Generic.KeyValuePair<,>))
MS\Internal\WindowsRuntime\Generated\WinRT\ObjectReference.cs (1)
208if (typeof(T).IsGenericType)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (2)
42if (publicType.IsGenericType) 61if (abiType.IsGenericType)
MS\Internal\WindowsRuntime\Generated\WinRT\TypeExtensions.cs (1)
51if (helperType.IsGenericType && vftblType is not null)
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)
694if (interfaceType.IsGenericType)
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
149if (type.IsGenericType)
System\Windows\Markup\XamlTypeMapper.cs (1)
776string fullName = owner.IsGenericType ? $"{owner.Namespace}.{owner.Name}" : owner.FullName;
System.CodeDom (1)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
104if (type.IsGenericType && !type.ContainsGenericParameters)
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
311&& (!expectedValueType.IsGenericType
System\ComponentModel\DataAnnotations\Validator.cs (1)
361(destinationType.IsGenericType &&
System.ComponentModel.Composition (13)
Microsoft\Internal\Collections\CollectionServices.cs (1)
22if (type.IsGenericType)
Microsoft\Internal\ReflectionServices.cs (1)
94instanceType.IsGenericType &&
System\ComponentModel\Composition\ContractNameServices.cs (3)
122if (type.IsGenericType) 228if (type.DeclaringType.IsGenericType) 246if (!type.IsGenericType)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (3)
65if ((memberType != null) && memberType.IsGenericType && specifiedContractType.IsGenericType) 500if (type.IsGenericType)
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (3)
18if (type.IsGenericType && type.ContainsGenericParameters) 41if (type.IsGenericType && type.ContainsGenericParameters) 56if (type.IsGenericType)
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (2)
100if (type.IsGenericType && type.GetGenericTypeDefinition() == baseGenericTypeDefinition) 124if (!type.IsGenericType)
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.TypedParts (2)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
101if (_constructor == null && _partType.IsGenericType)
System\Composition\TypedParts\Discovery\TypeInspector.cs (1)
190if (ifce == contractType || (ifce.IsGenericType && ifce.GetGenericTypeDefinition() == contractType.AsType()))
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)
732if (!iFaceTypeInfo.IsGenericType ||
System\Diagnostics\Metrics\AggregationManager.cs (1)
310genericDefType = type.IsGenericType ? type.GetGenericTypeDefinition() : null;
System.Linq.Expressions (8)
System\Dynamic\Utils\TypeUtils.cs (5)
16.Where(i => i.IsGenericType) 442if (!source.IsSZArray || !dest.IsInterface || !dest.IsGenericType) 469if (!dest.IsSZArray || !source.IsInterface || !source.IsGenericType) 531if (!IsDelegate(source) || !IsDelegate(dest) || !source.IsGenericType || !dest.IsGenericType)
System\Linq\Expressions\Compiler\ILGen.cs (1)
442if (dt != null && dt.IsGenericType)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
616Debug.Assert(siteType.IsGenericType && siteType.GetGenericTypeDefinition() == typeof(CallSite<>));
System\Runtime\CompilerServices\CallSite.cs (1)
290&& target.IsGenericType && IsSimpleSignature(invoke, out Type[] args))
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<>)) 160if (pubType.IsInterface && pubType.IsGenericType) 176.Where(i => i.IsGenericType && i.GenericTypeArguments.Length == 1)
System\Linq\TypeHelper.cs (1)
21if (type.IsGenericType && type.GetGenericTypeDefinition() == definition)
System.Private.CoreLib (40)
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)
107if (nullableType.IsGenericType && !nullableType.IsGenericTypeDefinition)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
44if (!t.IsGenericType || t.IsGenericTypeDefinition)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
290if (rootType.IsGenericType && (!rootType.IsGenericTypeDefinition || format == Format.ToString))
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
16Debug.Assert(unmodifiedType.IsGenericType);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (2)
40else if (unmodifiedType.IsGenericType) 80public override bool IsGenericType => _unmodifiedType.IsGenericType;
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (7)
374if (underlyingType.IsGenericType) 393if (underlyingType.IsGenericType) 444if ((type != null) && type.IsGenericType && !type.IsGenericTypeDefinition) 542Type contextTypeDefinition = context.IsGenericType && !context.IsGenericTypeDefinition ? context.GetGenericTypeDefinition() : context; 554if (!baseType.IsGenericType 578if (underlyingType.IsGenericType) 612if (!isValueType || (Nullable.GetUnderlyingType(nullability.Type) ?? nullability.Type).IsGenericType)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (3)
567if (structureType.IsGenericType) 615if (structureType.IsGenericType) 1075if (type.IsGenericType)
src\libraries\System.Private.CoreLib\src\System\Type.cs (1)
79public virtual Type[] GenericTypeArguments => (IsGenericType && !IsGenericTypeDefinition) ? GetGenericArguments() : EmptyTypes;
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (2)
52if (!IsGenericType) 105if (IsGenericType && !IsGenericTypeDefinition)
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)
191if (currentType.IsGenericType &&
src\System\Reflection\Emit\RuntimeConstructorBuilder.cs (1)
148if (DeclaringType!.IsGenericType)
src\System\Reflection\Emit\RuntimeFieldBuilder.cs (1)
146if (!(m_fieldType.IsGenericType && m_fieldType.GetGenericTypeDefinition() == typeof(Nullable<>)))
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (8)
217Debug.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments."); 331if (method.DeclaringType!.IsGenericType) 350if (method.DeclaringType!.IsGenericType) 908if ((type.IsGenericType && (!type.IsGenericTypeDefinition || !getGenericDefinition)) 1077|| (methodInfoUnbound.DeclaringType != null && methodInfoUnbound.DeclaringType.IsGenericType)) 1102(method.DeclaringType == null || !method.DeclaringType.IsGenericType)) 1181if (field.DeclaringType != null && field.DeclaringType.IsGenericType) 1212if (field.DeclaringType != null && field.DeclaringType.IsGenericType)
src\System\Reflection\Emit\SignatureHelper.cs (1)
333else if (clsArgument.IsGenericType && (!clsArgument.IsGenericTypeDefinition || !lastWasGenericInst))
src\System\Reflection\FieldInfo.CoreCLR.cs (1)
16if (declaringType != null && declaringType.IsGenericType)
src\System\Reflection\MethodBase.CoreCLR.cs (1)
23if (declaringType != null && declaringType.IsGenericType)
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
256if (m_ctor!.DeclaringType!.IsGenericType)
src\System\Reflection\RuntimeModule.cs (1)
111if (declaringType.IsGenericType || declaringType.IsArray)
src\System\RuntimeType.CoreCLR.cs (1)
2728if (IsSZArray && interfaceType.IsGenericType)
System.Private.DataContractSerialization (41)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
104if (type.IsGenericType && !type.ContainsGenericParameters)
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<>)); 1317if (!type.IsGenericType || !type.ContainsGenericParameters)
System\Runtime\Serialization\CollectionDataContract.cs (8)
876if (interfaceType.IsGenericType 927if (type.IsGenericType) 1002return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 1051Type interfaceTypeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 1058if (type.IsGenericType) 1133Type interfaceTypeToCheck = interfaceType.IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1164itemType = knownInterfaceType.IsGenericType ? knownInterfaceType.GetGenericArguments()[0] : Globals.TypeOfObject; 1366Type typeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type;
System\Runtime\Serialization\DataContract.cs (7)
1147if (itemType.IsGenericType) 1164while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1174while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable) 1268if (type.IsGenericType && !type.IsGenericTypeDefinition) 1380if (type.IsGenericType && !type.IsGenericTypeDefinition) 1477if (type.IsGenericType) 1926(type.IsGenericType &&
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
564if (itemType.IsGenericType && (itemType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue))
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
295if (collectionDataContract.ItemType.IsGenericType
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)
399if (interfaceType.IsGenericType 635bool isNullableOfT = (memberType.IsGenericType && 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)
359oldItemContract.UnderlyingType.IsGenericType && 412if (collectionContract.ItemType.IsGenericType
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 (4)
125if (classDataContract.UnderlyingType.IsGenericType) 267if (clrType.IsGenericType) 367if (collectionDataContract.UnderlyingType.IsGenericType && CollectionDataContract.IsCollectionDataContract(collectionDataContract.UnderlyingType)) 470if (dataContract.UnderlyingType.IsGenericType)
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (1)
509while (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (3)
478if (interfaceType.IsGenericType 648bool isNullableOfT = (memberType.IsGenericType && 738while (memberType.IsGenericType && memberType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
System.Private.Windows.Core (4)
System\DisposalTracking.cs (1)
64if (type.IsGenericType)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
404return type.IsGenericType 717return type.IsGenericType
System\TypeExtensions.cs (1)
278type.IsGenericType && !type.IsGenericTypeDefinition && type.GetGenericTypeDefinition() == typeof(Nullable<>)
System.Private.Xml (13)
System\Xml\Serialization\CodeIdentifier.cs (1)
240Type[] arguments = t.IsGenericType || t.ContainsGenericParameters ? t.GetGenericArguments() : Type.EmptyTypes;
System\Xml\Serialization\Compiler.cs (1)
54if (type.IsGenericType)
System\Xml\Serialization\SoapReflectionImporter.cs (1)
778if (type.IsGenericType && typeName.Contains('{'))
System\Xml\Serialization\Types.cs (3)
951return t.IsGenericType && (t.GetGenericTypeDefinition() == typeof(ArraySegment<>)); 956if (type.IsGenericType) 978else if (t.IsGenericType)
System\Xml\Serialization\XmlReflectionImporter.cs (1)
973if (type.IsGenericType && typeName.Contains('{'))
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (2)
188if (type.IsGenericType || type.ContainsGenericParameters && DynamicAssemblies.IsTypeDynamic(type.GetGenericArguments())) 353if (type.IsGenericType || type.ContainsGenericParameters && DynamicAssemblies.IsTypeDynamic(type.GetGenericArguments()))
System\Xml\Serialization\XmlSerializationILGen.cs (2)
251if (type.IsGenericType || type.ContainsGenericParameters) 454if (type.IsGenericType || type.ContainsGenericParameters)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
2819Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType)));
System\Xml\Serialization\XmlSerializationWriter.cs (1)
1506else if (type.IsGenericType)
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
89get { return _typeInfo.IsGenericType; }
System.Reflection.Emit (4)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
290if (rootType.IsGenericType && (!rootType.IsGenericTypeDefinition || format == Format.ToString))
System\Reflection\Emit\ConstructorBuilderImpl.cs (1)
55if (DeclaringType!.IsGenericType)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
696(type.IsGenericType && !type.IsGenericTypeDefinition))
System\Reflection\Emit\SignatureHelper.cs (1)
194else if (type.IsGenericType)
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\FormatterServices.cs (1)
353if (!type.IsGenericType)
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\SchemaImportHelper.cs (1)
62(type.IsGenericType &&
System.Text.Json (12)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (8)
49Debug.Assert(baseType.IsGenericType); 57if (baseTypeToCheck.IsGenericType) 86Debug.Assert(interfaceType.IsGenericType); 92if (interfaceToCheck.IsGenericType) 104if (typeToCheck.IsGenericType) 119if (!type.IsGenericType || !type.Assembly.FullName!.StartsWith("System.Collections.Immutable", StringComparison.Ordinal)) 137if (!type.IsGenericType || !type.Assembly.FullName!.StartsWith("System.Collections.Immutable", StringComparison.Ordinal)) 225=> type.IsGenericType && type.GetGenericTypeDefinition() == typeof(KeyValuePair<,>);
System\ReflectionExtensions.cs (1)
22type.IsGenericType && type.GetGenericTypeDefinition() == s_nullableType;
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (1)
15if (!typeToConvert.IsGenericType || !typeToConvert.IsValueType)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
120Debug.Assert(underlyingIDictionaryType.IsGenericType);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (1)
127if (type.IsGenericType)
System.Windows.Forms (3)
System\Windows\Forms\DataBinding\ListBindingHelper.cs (2)
502if (type.IsGenericType && !type.IsGenericTypeDefinition) 513if (curInterface.IsGenericType)
System\Windows\Forms\Internal\Formatter.cs (1)
504if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
System.Windows.Forms.Design (2)
System\ComponentModel\Design\EventBindingService.cs (2)
148if (evInfo is null || !evInfo.EventHandlerType!.IsGenericType) 159if (args[i].IsGenericType)
System.Xaml (7)
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)
1455if (type is null || !type.IsGenericType)
System\Xaml\Schema\CollectionReflector.cs (2)
283if (type.IsGenericType && type.GetGenericTypeDefinition() == interfaceType) 290if (currentInterface.IsGenericType && currentInterface.GetGenericTypeDefinition() == interfaceType)
System\Xaml\Schema\TypeReflector.cs (1)
140if (type.IsGenericType)
System\Xaml\XamlObjectReader.cs (1)
1286if (!(parameterInfo.ParameterType.IsGenericType &&
System\Xaml\XamlType.cs (1)
1603if (!genericType.IsGenericType)
xunit.assert (7)
Assert.cs (1)
73 if (!type.IsGenericType)
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; 527 else if (typeInfo.IsGenericType) 545 if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(KeyValuePair<,>)) 588 where @interface.GetTypeInfo().IsGenericType