4 instantiations of ResourceAsset
Microsoft.AspNetCore.Components.Endpoints (2)
src\Shared\Components\ResourceCollectionResolver.cs (2)
119resources.Add(new ResourceAsset(descriptor.Route, properties)); 123resources.Add(new ResourceAsset(descriptor.Route, null));
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
src\Shared\Components\ResourceCollectionResolver.cs (2)
119resources.Add(new ResourceAsset(descriptor.Route, properties)); 123resources.Add(new ResourceAsset(descriptor.Route, null));
50 references to ResourceAsset
Microsoft.AspNetCore.Components (13)
ResourceAssetCollection.cs (13)
12public sealed class ResourceAssetCollection : IReadOnlyList<ResourceAsset> 19private readonly FrozenDictionary<string, ResourceAsset> _uniqueUrlMappings; 21private readonly IReadOnlyList<ResourceAsset> _resources; 27public ResourceAssetCollection(IReadOnlyList<ResourceAsset> resources) 29var mappings = new Dictionary<string, ResourceAsset>(StringComparer.OrdinalIgnoreCase); 32foreach (var resource in resources) 38if (mappings.TryGetValue(property.Value, out var value)) 57public string this[string key] => _uniqueUrlMappings.TryGetValue(key, out var value) ? value.Url : key; 67ResourceAsset IReadOnlyList<ResourceAsset>.this[int index] => _resources[index]; 68int IReadOnlyCollection<ResourceAsset>.Count => _resources.Count; 69IEnumerator<ResourceAsset> IEnumerable<ResourceAsset>.GetEnumerator() => _resources.GetEnumerator();
Microsoft.AspNetCore.Components.Endpoints (10)
Assets\ImportMapDefinition.cs (2)
59foreach (var asset in assets) 85private static (string? integrity, string? label) GetAssetProperties(ResourceAsset asset)
Builder\ResourceCollectionUrlEndpoint.cs (4)
100JsonSerializer.Serialize<IReadOnlyList<ResourceAsset>>(utf8Writer, resourceCollection, ResourceCollectionSerializerContext.Default.Options); 112var resources = (IReadOnlyList<ResourceAsset>)resourceCollection; 117foreach (var resource in resources) 154[JsonSerializable(typeof(IReadOnlyList<ResourceAsset>))]
src\Components\Shared\src\ResourceCollectionProvider.cs (2)
57[DynamicDependency(JsonSerialized, typeof(ResourceAsset))] 67var result = await module.InvokeAsync<ResourceAsset[]>("get");
src\Shared\Components\ResourceCollectionResolver.cs (2)
34var resources = new List<ResourceAsset>(); 95List<ResourceAsset> resources,
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (6)
76var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 97var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 119var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 141var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 164var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 190var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata);
Microsoft.AspNetCore.Components.Tests (1)
ResourceAssetCollectionTest.cs (1)
17var collectionAsReadOnlyList = resourceAssetCollection as IReadOnlyList<ResourceAsset>;
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\ResourceCollectionProvider.cs (2)
57[DynamicDependency(JsonSerialized, typeof(ResourceAsset))] 67var result = await module.InvokeAsync<ResourceAsset[]>("get");
Microsoft.AspNetCore.Mvc.RazorPages.Test (8)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (8)
35var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 56var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 77var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 99var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 122var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 145var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 171var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 197var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata);
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
src\Shared\Components\ResourceCollectionResolver.cs (2)
34var resources = new List<ResourceAsset>(); 95List<ResourceAsset> resources,
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (8)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (8)
43var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 73var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 104var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 135var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 167var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 199var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 234var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata); 269var list = Assert.IsAssignableFrom<IReadOnlyList<ResourceAsset>>(metadata);