Implemented interface member:
method
TryGetContentType
Microsoft.AspNetCore.StaticFiles.IContentTypeProvider.TryGetContentType(System.String, out System.String)
10 references to TryGetContentType
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (1)
121if (originalPath != null && contentTypeProvider.TryGetContentType(originalPath, out var originalContentType))
Microsoft.AspNetCore.StaticFiles.Tests (9)
DefaultContentTypeProviderTests.cs (9)
13Assert.False(provider.TryGetContentType("unknown.ext", out contentType)); 20Assert.True(provider.TryGetContentType("known.txt", out var contentType)); 29Assert.False(provider.TryGetContentType("known.exe.config", out contentType)); 36Assert.True(provider.TryGetContentType("known.dvr-ms", out var contentType)); 44Assert.True(provider.TryGetContentType(@"/first/example.txt", out var contentType)); 46Assert.True(provider.TryGetContentType(@"\second\example.txt", out contentType)); 54Assert.True(provider.TryGetContentType(@"/first.css/example.txt", out var contentType)); 56Assert.True(provider.TryGetContentType(@"\second.css\example.txt", out contentType)); 65Assert.True(provider.TryGetContentType($"{new string(System.IO.Path.GetInvalidPathChars())}.txt", out contentType));