3 instantiations of DeclaredApiResponseMetadata
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
DeclaredApiResponseMetadata.cs (3)
12new DeclaredApiResponseMetadata(statusCode: 200, attributeData: null, attributeSource: null, @implicit: true, @default: false); 16return new DeclaredApiResponseMetadata(statusCode, attributeData, attributeSource, @implicit: false, @default: false); 21return new DeclaredApiResponseMetadata(statusCode: 0, attributeData, attributeSource, @implicit: false, @default: true);
34 references to DeclaredApiResponseMetadata
Microsoft.AspNetCore.Mvc.Api.Analyzers (25)
AddResponseTypeAttributeCodeFixAction.cs (3)
169private static ICollection<(int statusCode, ITypeSymbol? typeSymbol)> CalculateStatusCodesToApply(in CodeActionContext context, IList<DeclaredApiResponseMetadata> declaredResponseMetadata) 182if (DeclaredApiResponseMetadata.TryGetDeclaredMetadata(declaredResponseMetadata, metadata, result: out var declaredMetadata) &&
ApiConventionAnalyzer.cs (3)
55if (!DeclaredApiResponseMetadata.Contains(declaredResponseMetadata, actualMetadata)) 83var declaredMetadata = declaredResponseMetadata[i]; 95internal static bool Contains(IList<ActualApiResponseMetadata> actualResponseMetadata, DeclaredApiResponseMetadata declaredMetadata)
DeclaredApiResponseMetadata.cs (9)
11public static DeclaredApiResponseMetadata ImplicitResponse { get; } = 14public static DeclaredApiResponseMetadata ForProducesResponseType(int statusCode, AttributeData attributeData, IMethodSymbol attributeSource) 19public static DeclaredApiResponseMetadata ForProducesDefaultResponse(AttributeData attributeData, IMethodSymbol attributeSource) 45/// <c>True</c> if this <see cref="DeclaredApiResponseMetadata" /> is the implicit 200 associated with an 51/// <c>True</c> if this <see cref="DeclaredApiResponseMetadata" /> is from a <c>ProducesDefaultResponseTypeAttribute</c>. 56internal static bool Contains(IList<DeclaredApiResponseMetadata> declaredApiResponseMetadata, ActualApiResponseMetadata actualMetadata) 62IList<DeclaredApiResponseMetadata> declaredApiResponseMetadata, 64out DeclaredApiResponseMetadata result) 68var declaredMetadata = declaredApiResponseMetadata[i];
SymbolApiResponseMetadataProvider.cs (10)
15private static readonly IList<DeclaredApiResponseMetadata> DefaultResponseMetadatas = new[] 17DeclaredApiResponseMetadata.ImplicitResponse, 20public static IList<DeclaredApiResponseMetadata> GetDeclaredResponseMetadata( 64private static IList<DeclaredApiResponseMetadata> GetResponseMetadataFromConventions( 80return Array.Empty<DeclaredApiResponseMetadata>(); 140private static IList<DeclaredApiResponseMetadata> GetResponseMetadataFromMethodAttributes(in ApiControllerSymbolCache symbolCache, IMethodSymbol methodSymbol) 142var metadataItems = new List<DeclaredApiResponseMetadata>(); 147var metadata = DeclaredApiResponseMetadata.ForProducesResponseType(statusCode, attribute, attributeSource: methodSymbol); 155metadataItems.Add(DeclaredApiResponseMetadata.ForProducesDefaultResponse(producesDefaultResponse, methodSymbol));
Mvc.Api.Analyzers.Test (9)
DeclaredApiResponseMetadataTest.cs (9)
20var declaredMetadata = DeclaredApiResponseMetadata.ImplicitResponse; 34var declaredMetadata = DeclaredApiResponseMetadata.ImplicitResponse; 48var declaredMetadata = DeclaredApiResponseMetadata.ForProducesResponseType(200, AttributeData, Mock.Of<IMethodSymbol>()); 66var declaredMetadata = DeclaredApiResponseMetadata.ForProducesResponseType(201, AttributeData, Mock.Of<IMethodSymbol>()); 84var declaredMetadata = DeclaredApiResponseMetadata.ForProducesResponseType(201, AttributeData, Mock.Of<IMethodSymbol>()); 98var declaredMetadata = DeclaredApiResponseMetadata.ForProducesResponseType(302, AttributeData, Mock.Of<IMethodSymbol>()); 115var declaredMetadata = DeclaredApiResponseMetadata.ForProducesDefaultResponse(AttributeData, Mock.Of<IMethodSymbol>()); 129var declaredMetadata = DeclaredApiResponseMetadata.ForProducesDefaultResponse(AttributeData, Mock.Of<IMethodSymbol>()); 143var declaredMetadata = DeclaredApiResponseMetadata.ForProducesDefaultResponse(AttributeData, Mock.Of<IMethodSymbol>());