1 write to Metadata
Microsoft.AspNetCore.Http.Abstractions (1)
540 references to Metadata
CookieSample (1)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.Authorization.Policy (4)
Microsoft.AspNetCore.Components.Endpoints (10)
Microsoft.AspNetCore.Components.Endpoints.Tests (34)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Cors (1)
Microsoft.AspNetCore.Cors.Test (3)
Microsoft.AspNetCore.Diagnostics (4)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (13)
JsonTranscodingServiceMethodProviderTests.cs (13)
30Assert.Equal("GET", endpoint.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
46Assert.Equal("HEAD", endpoint.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
61Assert.Equal("GET", getMethodModel.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
62Assert.Equal("/v1/additional_bindings/{name}", getMethodModel.Metadata.GetMetadata<GrpcJsonTranscodingMetadata>()?.HttpRule.Get);
66Assert.Equal("DELETE", additionalMethodModel.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
67Assert.Equal("/v1/additional_bindings/{name}", additionalMethodModel.Metadata.GetMetadata<GrpcJsonTranscodingMetadata>()?.HttpRule.Delete);
81Assert.Equal("POST", startFrameImport.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
82Assert.Equal("/v1/frames:startFrameImport", startFrameImport.Metadata.GetMetadata<GrpcJsonTranscodingMetadata>()?.HttpRule.Post);
85Assert.Equal("POST", getFrameImport.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
86Assert.Equal("/v1/frames:getFrameImport", getFrameImport.Metadata.GetMetadata<GrpcJsonTranscodingMetadata>()?.HttpRule.Post);
157Assert.Equal("GET", endpoint.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Single());
158Assert.Equal("/v1/server_greeter/{name}", endpoint.Metadata.GetMetadata<GrpcJsonTranscodingMetadata>()?.HttpRule.Get);
237.Where(e => e.Metadata.GetMetadata<GrpcMethodMetadata>()?.Method.Name == methodName)
Microsoft.AspNetCore.Grpc.Swagger (4)
Microsoft.AspNetCore.Hosting (2)
Microsoft.AspNetCore.Http (4)
Microsoft.AspNetCore.Http.Abstractions (6)
Microsoft.AspNetCore.Http.Connections.Tests (28)
Microsoft.AspNetCore.Http.Extensions (3)
Microsoft.AspNetCore.Http.Extensions.Tests (68)
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (44)
33var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
49var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
65var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>();
79var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
93var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
107var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
121var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
136var metadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
152_ = endpoint.Metadata.OfType<CustomMetadata>().Single(m => m.Value == 42);
153_ = endpoint.Metadata.OfType<CustomMetadata>().Single(m => m.Value == 24);
167var metadata = endpoint.Metadata.OfType<CustomMetadata>().Single();
179var responseMetadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
193var responseMetadata = endpoint.Metadata.OfType<IProducesResponseTypeMetadata>().Single();
211Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
212Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param2" });
227Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
242Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
257Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
272Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
288Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
303Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
318Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
333Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
348Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
368Assert.Contains(endpoint.Metadata, m => m is MetadataService);
388Assert.Contains(endpoint.Metadata, m => m is MetadataService);
402Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
404Assert.Contains(endpoint.Metadata, m => m is MetadataCountMetadata { Count: > 1 });
419Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
421Assert.Contains(endpoint.Metadata, m => m is MetadataCountMetadata { Count: > 1 });
436Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
438Assert.Contains(endpoint.Metadata, m => m is MetadataCountMetadata { Count: > 1 });
453Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
454Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
469Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
470Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
485Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
486Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
501Assert.Contains(endpoint.Metadata, m => m is RoutePatternMetadata { RoutePattern: "/test/pattern" });
521var filteredMetadata = endpoint.Metadata.Where(
560Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
561Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
562Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Property });
563Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: nameof(AddsCustomParameterMetadata.Data) });
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.HttpLogging.Tests (1)
Microsoft.AspNetCore.Mvc.ApiExplorer (10)
Microsoft.AspNetCore.Mvc.Core (16)
Microsoft.AspNetCore.Mvc.Core.Test (81)
ApplicationModels\EndpointMetadataProviderTest.cs (16)
38Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
49endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType }),
50endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType }));
60Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
71endpoint => Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" }),
72endpoint => Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" }));
82Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
93endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter }),
94endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter }));
120endpoint.Metadata,
158Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
179Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
200Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata);
211endpoint => Assert.Contains(endpoint.Metadata, m => m is RoutePatternMetadata { RoutePattern: "selector1" }),
212endpoint => Assert.Contains(endpoint.Metadata, m => m is RoutePatternMetadata { RoutePattern: "selector2" }));
226if (endpoint.Metadata is not [SuppressMatchingMetadata, ..])
Routing\ControllerActionEndpointDataSourceTest.cs (61)
95Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
100Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
108Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
109Assert.Equal("1", e.Metadata.GetMetadata<IRouteNameMetadata>().RouteName);
110Assert.Equal("1", e.Metadata.GetMetadata<IEndpointNameMetadata>().EndpointName);
115Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
116Assert.Equal("2", e.Metadata.GetMetadata<IRouteNameMetadata>().RouteName);
117Assert.Equal("2", e.Metadata.GetMetadata<IEndpointNameMetadata>().EndpointName);
122Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
123Assert.Equal("Test", e.Metadata.GetMetadata<IRouteNameMetadata>().RouteName);
124Assert.Equal("Test", e.Metadata.GetMetadata<IEndpointNameMetadata>().EndpointName);
177Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
178Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
183Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
184Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
192Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
193Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
198Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
199Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
204Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
205Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
264Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
269Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
277Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
278Assert.Equal("1", e.Metadata.GetMetadata<IRouteNameMetadata>().RouteName);
279Assert.Equal("1", e.Metadata.GetMetadata<IEndpointNameMetadata>().EndpointName);
284Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
285Assert.Equal("2", e.Metadata.GetMetadata<IRouteNameMetadata>().RouteName);
286Assert.Equal("2", e.Metadata.GetMetadata<IEndpointNameMetadata>().EndpointName);
291Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
292Assert.Equal("Test", e.Metadata.GetMetadata<IRouteNameMetadata>().RouteName);
293Assert.Equal("NewName", e.Metadata.GetMetadata<IEndpointNameMetadata>().EndpointName);
346Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
347Assert.Equal(new[] { "Hi there", "A" }, e.Metadata.GetOrderedMetadata<string>());
352Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
353Assert.Equal(new[] { "Hi there", "B" }, e.Metadata.GetOrderedMetadata<string>());
361Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
362Assert.Equal(new[] { "Hi there", "A" }, e.Metadata.GetOrderedMetadata<string>());
367Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
368Assert.Equal(new[] { "Hi there", "B" }, e.Metadata.GetOrderedMetadata<string>());
373Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
374Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
440Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
441Assert.Equal(new[] { "group", "Hi there", "A" }, e.Metadata.GetOrderedMetadata<string>());
442Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
447Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
448Assert.Equal(new[] { "group", "Hi there", "B" }, e.Metadata.GetOrderedMetadata<string>());
449Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
457Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
459Assert.Equal(new[] { "group", "Hi there", "A" }, e.Metadata.GetOrderedMetadata<string>());
460Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
465Assert.Null(e.Metadata.GetMetadata<ActionDescriptor>());
466Assert.Equal(new[] { "group", "Hi there", "B" }, e.Metadata.GetOrderedMetadata<string>());
467Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
472Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
474Assert.Equal(new[] { "group", "A", "Hi there" }, e.Metadata.GetOrderedMetadata<string>());
475Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
530Assert.Equal(new[] { "A1", "A2", "C1", "C2" }, e.Metadata.GetOrderedMetadata<string>());
535Assert.Equal(new[] { "B1", "B2", "C1", "C2" }, e.Metadata.GetOrderedMetadata<string>());
540Assert.Equal(new[] { "C1", "C2" }, e.Metadata.GetOrderedMetadata<string>());
548return !(endpoint.Metadata.GetMetadata<ISuppressLinkGenerationMetadata>()?.SuppressLinkGeneration == true);
Microsoft.AspNetCore.Mvc.Razor (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
Microsoft.AspNetCore.Mvc.RazorPages (8)
Microsoft.AspNetCore.Mvc.RazorPages.Test (20)
Infrastructure\PageActionEndpointDataSourceTest.cs (12)
88Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
89Assert.Equal("Hi there", e.Metadata.GetMetadata<string>());
158Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
159Assert.Equal(new[] { "group", "A", "Hi there" }, e.Metadata.GetOrderedMetadata<string>());
160Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
165Assert.Same(actions[1], e.Metadata.GetMetadata<ActionDescriptor>());
166Assert.Equal(new[] { "group", "B", "Hi there" }, e.Metadata.GetOrderedMetadata<string>());
167Assert.NotNull(e.Metadata.GetMetadata<GroupMetadata>());
208Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
209Assert.Equal(new[] { "A1", "A2" }, e.Metadata.GetOrderedMetadata<string>());
256Assert.Same(actions[0], e.Metadata.GetMetadata<ActionDescriptor>());
257Assert.Equal(new[] { "initial-metadata", "initial-metadata-observed" }, e.Metadata.GetOrderedMetadata<string>());
Microsoft.AspNetCore.Mvc.TagHelpers (3)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (24)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.OpenApi.Tests (7)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.RateLimiting (3)
Microsoft.AspNetCore.RateLimiting.Tests (3)
Microsoft.AspNetCore.RequestDecompression (1)
Microsoft.AspNetCore.Routing (42)
Microsoft.AspNetCore.Routing.Tests (82)
Microsoft.AspNetCore.SignalR.Tests (24)
MapSignalRTests.cs (24)
90Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
95Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
123Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
124var policies = endpoint.Metadata.GetOrderedMetadata<AuthorizationPolicy>();
133Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
134var policies = endpoint.Metadata.GetOrderedMetadata<AuthorizationPolicy>();
162Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
167Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
191Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count);
196Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count);
220Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
225Assert.Single(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>());
252Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count);
257Assert.Equal(2, endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>().Count);
284Assert.Collection(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>(),
294Assert.Collection(endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>(),
323Assert.Equal(typeof(AuthHub), endpoint.Metadata.GetMetadata<HubMetadata>()?.HubType);
324Assert.NotNull(endpoint.Metadata.GetMetadata<NegotiateMetadata>());
329Assert.Equal(typeof(AuthHub), endpoint.Metadata.GetMetadata<HubMetadata>()?.HubType);
330Assert.Null(endpoint.Metadata.GetMetadata<NegotiateMetadata>());
354Assert.Equal(typeof(AuthHub), endpoint.Metadata.GetMetadata<HubMetadata>()?.HubType);
355Assert.NotNull(endpoint.Metadata.GetMetadata<NegotiateMetadata>());
360Assert.Equal(typeof(AuthHub), endpoint.Metadata.GetMetadata<HubMetadata>()?.HubType);
361Assert.Null(endpoint.Metadata.GetMetadata<NegotiateMetadata>());
Microsoft.AspNetCore.StaticAssets (2)
Microsoft.AspNetCore.Tests (4)
MinimalSample (1)
Mvc.RoutingWebSite (1)
RoutingSandbox (1)
RoutingWebSite (1)
SignalR.Client.FunctionalTestApp (1)
StaticFilesAuth (1)