193 references to WellKnownType
Microsoft.AspNetCore.App.Analyzers (191)
Authorization\AddAuthorizationBuilderAnalyzer.cs (2)
14using WellKnownType = WellKnownTypeData.WellKnownType; 38var policyServiceCollectionExtensions = wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_PolicyServiceCollectionExtensions);
Authorization\AuthorizationOptionsTypes.cs (2)
10using WellKnownType = WellKnownTypeData.WellKnownType; 16AuthorizationOptions = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Authorization_AuthorizationOptions);
Http\HeaderDictionaryAddAnalyzer.cs (2)
12using WellKnownType = WellKnownTypeData.WellKnownType; 36&& SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IHeaderDictionary), invocation.Instance?.Type))
Http\RequestDelegateReturnTypeAnalyzer.cs (5)
12using WellKnownType = WellKnownTypeData.WellKnownType; 33SymbolEqualityComparer.Default.Equals(parent.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate))) 38if (SymbolEqualityComparer.Default.Equals(returnType.OriginalDefinition, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_Task_T))) 49SymbolEqualityComparer.Default.Equals(parent.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate))) 64if (returnType != null && SymbolEqualityComparer.Default.Equals(returnType.OriginalDefinition, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_Task_T)))
Mvc\DetectAmbiguousActionRoutes.cs (45)
17using WellKnownType = WellKnownTypeData.WellKnownType; 122var actionNameAttribute = actionSymbol.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_ActionNameAttribute), inherit: true).FirstOrDefault(); 168private static readonly WellKnownType[] KnownMethodAttributeTypes = new[] 170WellKnownType.Microsoft_AspNetCore_Mvc_RouteAttribute, 171WellKnownType.Microsoft_AspNetCore_Mvc_HttpDeleteAttribute, 172WellKnownType.Microsoft_AspNetCore_Mvc_HttpGetAttribute, 173WellKnownType.Microsoft_AspNetCore_Mvc_HttpHeadAttribute, 174WellKnownType.Microsoft_AspNetCore_Mvc_HttpOptionsAttribute, 175WellKnownType.Microsoft_AspNetCore_Mvc_HttpPatchAttribute, 176WellKnownType.Microsoft_AspNetCore_Mvc_HttpPostAttribute, 177WellKnownType.Microsoft_AspNetCore_Mvc_HttpPutAttribute, 178WellKnownType.Microsoft_AspNetCore_Http_EndpointDescriptionAttribute, 179WellKnownType.Microsoft_AspNetCore_Http_EndpointSummaryAttribute, 180WellKnownType.Microsoft_AspNetCore_Http_TagsAttribute, 181WellKnownType.Microsoft_AspNetCore_Routing_EndpointGroupNameAttribute, 182WellKnownType.Microsoft_AspNetCore_Routing_EndpointNameAttribute, 183WellKnownType.Microsoft_AspNetCore_Routing_ExcludeFromDescriptionAttribute, 184WellKnownType.Microsoft_AspNetCore_Cors_DisableCorsAttribute, 185WellKnownType.Microsoft_AspNetCore_Cors_EnableCorsAttribute, 186WellKnownType.Microsoft_AspNetCore_OutputCaching_OutputCacheAttribute, 187WellKnownType.Microsoft_AspNetCore_RateLimiting_DisableRateLimitingAttribute, 188WellKnownType.Microsoft_AspNetCore_RateLimiting_EnableRateLimitingAttribute, 189WellKnownType.Microsoft_AspNetCore_Mvc_ActionNameAttribute, 190WellKnownType.Microsoft_AspNetCore_Mvc_DisableRequestSizeLimitAttribute, 191WellKnownType.Microsoft_AspNetCore_Mvc_FormatFilterAttribute, 192WellKnownType.Microsoft_AspNetCore_Mvc_ProducesAttribute, 193WellKnownType.Microsoft_AspNetCore_Mvc_ProducesDefaultResponseTypeAttribute, 194WellKnownType.Microsoft_AspNetCore_Mvc_ProducesErrorResponseTypeAttribute, 195WellKnownType.Microsoft_AspNetCore_Mvc_ProducesResponseTypeAttribute, 196WellKnownType.Microsoft_AspNetCore_Mvc_RequestFormLimitsAttribute, 197WellKnownType.Microsoft_AspNetCore_Mvc_RequestSizeLimitAttribute, 198WellKnownType.Microsoft_AspNetCore_Mvc_RequireHttpsAttribute, 199WellKnownType.Microsoft_AspNetCore_Mvc_ResponseCacheAttribute, 200WellKnownType.Microsoft_AspNetCore_Mvc_ServiceFilterAttribute, 201WellKnownType.Microsoft_AspNetCore_Mvc_TypeFilterAttribute, 202WellKnownType.Microsoft_AspNetCore_Mvc_ApiExplorer_ApiConventionNameMatchAttribute, 203WellKnownType.Microsoft_AspNetCore_Mvc_Filters_ResultFilterAttribute, 204WellKnownType.Microsoft_AspNetCore_Mvc_Infrastructure_DefaultStatusCodeAttribute, 205WellKnownType.Microsoft_AspNetCore_Mvc_AutoValidateAntiforgeryTokenAttribute, 206WellKnownType.Microsoft_AspNetCore_Mvc_IgnoreAntiforgeryTokenAttribute, 207WellKnownType.Microsoft_AspNetCore_Mvc_ViewFeatures_SaveTempDataAttribute, 208WellKnownType.Microsoft_AspNetCore_Mvc_SkipStatusCodePagesAttribute, 209WellKnownType.Microsoft_AspNetCore_Mvc_ValidateAntiForgeryTokenAttribute, 210WellKnownType.Microsoft_AspNetCore_Authorization_AllowAnonymousAttribute, 211WellKnownType.Microsoft_AspNetCore_Authorization_AuthorizeAttribute
Mvc\DetectOverriddenAuthorizeAttribute.cs (6)
14using WellKnownType = WellKnownTypeData.WellKnownType; 117var attributeUsageAttributeType = wellKnownTypes.Get(WellKnownType.System_AttributeUsageAttribute); 166var authInterfaceType = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Authorization_IAuthorizeData); 167var authAttributeType = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Authorization_AuthorizeAttribute); 182var anonInterfaceType = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Authorization_IAllowAnonymous); 183var anonAttributeType = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Authorization_AllowAnonymousAttribute);
Mvc\MvcAnalyzer.cs (21)
19using WellKnownType = WellKnownTypeData.WellKnownType; 71var controllerRouteAttribute = namedTypeSymbol.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_RouteAttribute), inherit: true).FirstOrDefault(); 111var methods = match.Value is WellKnownType.Microsoft_AspNetCore_Mvc_RouteAttribute 142private static string? GetHttpMethod(WellKnownType match) 146WellKnownType.Microsoft_AspNetCore_Mvc_RouteAttribute => null,// No HTTP method. 147WellKnownType.Microsoft_AspNetCore_Mvc_HttpDeleteAttribute => "DELETE", 148WellKnownType.Microsoft_AspNetCore_Mvc_HttpGetAttribute => "GET", 149WellKnownType.Microsoft_AspNetCore_Mvc_HttpHeadAttribute => "HEAD", 150WellKnownType.Microsoft_AspNetCore_Mvc_HttpOptionsAttribute => "OPTIONS", 151WellKnownType.Microsoft_AspNetCore_Mvc_HttpPatchAttribute => "PATCH", 152WellKnownType.Microsoft_AspNetCore_Mvc_HttpPostAttribute => "POST", 153WellKnownType.Microsoft_AspNetCore_Mvc_HttpPutAttribute => "PUT", 158private static readonly WellKnownType[] RouteAttributeTypes = new[] 160WellKnownType.Microsoft_AspNetCore_Mvc_RouteAttribute, 161WellKnownType.Microsoft_AspNetCore_Mvc_HttpDeleteAttribute, 162WellKnownType.Microsoft_AspNetCore_Mvc_HttpGetAttribute, 163WellKnownType.Microsoft_AspNetCore_Mvc_HttpHeadAttribute, 164WellKnownType.Microsoft_AspNetCore_Mvc_HttpOptionsAttribute, 165WellKnownType.Microsoft_AspNetCore_Mvc_HttpPatchAttribute, 166WellKnownType.Microsoft_AspNetCore_Mvc_HttpPostAttribute, 167WellKnownType.Microsoft_AspNetCore_Mvc_HttpPutAttribute
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (2)
13using WellKnownType = WellKnownTypeData.WellKnownType; 60=> SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Components_Rendering_RenderTreeBuilder), targetMethod.ContainingType)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
30using WellKnownType = WellKnownTypeData.WellKnownType; 374if (SymbolEqualityComparer.Default.Equals(attributeTypeSymbol.ContainingSymbol, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_AsParametersAttribute)))
RouteEmbeddedLanguage\Infrastructure\MvcDetector.cs (4)
11using WellKnownType = WellKnownTypeData.WellKnownType; 24wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_ControllerAttribute), 25wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_NonControllerAttribute)); 36wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_NonActionAttribute),
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (5)
11using WellKnownType = WellKnownTypeData.WellKnownType; 30else if (child.HasAttribute(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_AsParametersAttribute))) 45var fromRouteMetadata = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromRouteMetadata); 75private static bool HasSpecialType(ISymbol child, WellKnownTypes wellKnownTypes, WellKnownType[] specialTypes) 85private static bool HasExplicitNonRouteAttribute(ISymbol child, WellKnownTypes wellKnownTypes, WellKnownType[] allNoneRouteMetadataTypes)
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (4)
16using WellKnownType = WellKnownTypeData.WellKnownType; 156if (SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_EndpointRouteBuilderExtensions), mapMethodSymbol.ContainingType)) 270a => SymbolEqualityComparer.Default.Equals(a.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Routing_IEndpointRouteBuilder)) || 271a.Type.Implements(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Routing_IEndpointRouteBuilder))))
RouteEmbeddedLanguage\Infrastructure\RouteWellKnownTypes.cs (17)
8using WellKnownType = WellKnownTypeData.WellKnownType; 14public static readonly WellKnownType[] ParameterSpecialTypes = new[] 16WellKnownType.System_Threading_CancellationToken, 17WellKnownType.Microsoft_AspNetCore_Http_HttpContext, 18WellKnownType.Microsoft_AspNetCore_Http_HttpRequest, 19WellKnownType.Microsoft_AspNetCore_Http_HttpResponse, 20WellKnownType.System_Security_Claims_ClaimsPrincipal, 21WellKnownType.Microsoft_AspNetCore_Http_IFormFileCollection, 22WellKnownType.Microsoft_AspNetCore_Http_IFormFile, 23WellKnownType.System_IO_Stream, 24WellKnownType.System_IO_Pipelines_PipeReader, 27public static readonly WellKnownType[] NonRouteMetadataTypes = new[] 29WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromBodyMetadata, 30WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromFormMetadata, 31WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromHeaderMetadata, 32WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromQueryMetadata, 33WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromServiceMetadata,
RouteHandlers\AtMostOneFromBodyAttribute.cs (3)
13using WellKnownType = WellKnownTypeData.WellKnownType; 22var fromBodyMetadataInterfaceType = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromBodyMetadata); 23var asParametersAttributeType = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_AsParametersAttribute);
RouteHandlers\DetectAmbiguousRoutes.cs (7)
18using WellKnownType = WellKnownTypeData.WellKnownType; 97if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_RoutingEndpointConventionBuilderExtensions))) 109else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_AuthorizationEndpointConventionBuilderExtensions))) 113else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_OpenApiRouteHandlerBuilderExtensions))) 128else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_CorsEndpointConventionBuilderExtensions))) 132else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_OutputCacheConventionBuilderExtensions))) 136else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_RateLimiterEndpointConventionBuilderExtensions)))
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (3)
12using WellKnownType = WellKnownTypeData.WellKnownType; 24var modelBindingAttribute = parameter.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_ModelBinding_IBinderTypeProviderMetadata)).FirstOrDefault() ?? 25parameter.GetAttributes(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_BindAttribute)).FirstOrDefault();
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (5)
14using WellKnownType = WellKnownTypeData.WellKnownType; 27var fromServiceMetadataTypeSymbol = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromServiceMetadata); 52WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromHeaderMetadata, 61WellKnownType.Microsoft_AspNetCore_Http_Metadata_IFromQueryMetadata, 97static bool ReportFromAttributeDiagnostic(OperationAnalysisContext context, WellKnownType fromMetadataInterfaceType, WellKnownTypes wellKnownTypes, IParameterSymbol parameter, INamedTypeSymbol parameterTypeSymbol, Location location)
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (6)
12using WellKnownType = WellKnownTypeData.WellKnownType; 36if (wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IResult).IsAssignableFrom(returnType)) 43(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_IActionResult).IsAssignableFrom(returnType) || 44wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_Infrastructure_IConvertToActionResult).IsAssignableFrom(returnType))) 74if (wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IResult).IsAssignableFrom(type)) 79if (wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Mvc_IActionResult).IsAssignableFrom(type))
RouteHandlers\RouteHandlerAnalyzer.cs (4)
16using WellKnownType = WellKnownTypeData.WellKnownType; 201SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_EndpointRouteBuilderExtensions), targetMethod.ContainingType) && 209if (SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.System_Delegate), parmeterType)) 213if (SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate), parmeterType))
src\Shared\RoslynUtils\ParsabilityHelper.cs (10)
16using WellKnownType = WellKnownTypeData.WellKnownType; 33if (SymbolEqualityComparer.Default.Equals(typeSymbol, wellKnownTypes.Get(WellKnownType.System_Uri))) 111SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_IFormatProvider)) && 117var iParsableTypeSymbol = wellKnownTypes.Get(WellKnownType.System_IParsable_T); 126var iBindableFromHttpContextTypeSymbol = wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IBindableFromHttpContext_T); 139SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 141SymbolEqualityComparer.Default.Equals(returnType.ConstructedFrom, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_ValueTask_T)) && 150SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 151SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_Reflection_ParameterInfo)) && 158return SymbolEqualityComparer.Default.Equals(returnType.ConstructedFrom, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_ValueTask_T)) &&
src\Shared\RoslynUtils\WellKnownTypes.cs (9)
34var typeId = (WellKnownTypeData.WellKnownType)i; 61public INamedTypeSymbol Get(WellKnownTypeData.WellKnownType type) 116public bool IsType(ITypeSymbol type, WellKnownTypeData.WellKnownType[] wellKnownTypes) => IsType(type, wellKnownTypes, out var _); 118public bool IsType(ITypeSymbol type, WellKnownTypeData.WellKnownType[] wellKnownTypes, [NotNullWhen(true)] out WellKnownTypeData.WellKnownType? match) 120foreach (var wellKnownType in wellKnownTypes) 133public bool Implements(ITypeSymbol type, WellKnownTypeData.WellKnownType[] interfaceWellKnownTypes) 135foreach (var wellKnownType in interfaceWellKnownTypes)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (27)
16using WellKnownType = WellKnownTypeData.WellKnownType; 41INamedTypeSymbol[] configureTypes = { wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Hosting_WebHostBuilderExtensions) }; 42INamedTypeSymbol[] configureWebHostTypes = { wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_Hosting_GenericHostWebHostBuilderExtensions) }; 45wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Hosting_HostingAbstractionsWebHostBuilderExtensions), 46wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Hosting_WebHostBuilderExtensions), 50wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_Hosting_HostingHostBuilderExtensions), 51wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Hosting_WebHostBuilderExtensions) 55wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_Hosting_HostingHostBuilderExtensions), 56wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder) 60wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder), 61wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder), 62wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Hosting_WebHostBuilderExtensions), 63wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_Hosting_HostingHostBuilderExtensions), 65INamedTypeSymbol[] configureHostTypes = { wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder) }; 68wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_EndpointRoutingApplicationBuilderExtensions), 69wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_WebApplication) 83wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder), 99wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder), 115wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder), 131wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder), 147wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder), 163wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder), 179wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder), 195wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureWebHostBuilder), 211wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder), 227wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_ConfigureHostBuilder), 245wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_WebApplication),
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
117var wellKnownTypeKeys = Enum.GetValues<WellKnownType>();
Microsoft.AspNetCore.App.CodeFixes (1)
Http\HeaderDictionaryAddFixer.cs (1)
72var annotation = new SyntaxAnnotation("SymbolId", DocumentationCommentId.CreateReferenceId(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HeaderDictionaryExtensions)));