16 instantiations of VirtualFileResult
FilesWebSite (3)
Controllers\EmbeddedFilesController.cs (3)
14
return new
VirtualFileResult
("/Greetings.txt", "text/plain")
24
return new
VirtualFileResult
("/Greetings.txt", "text/plain")
33
var file = new
VirtualFileResult
("/Greetings.txt", "text/plain")
Microsoft.AspNetCore.Mvc.Core (6)
ControllerBase.cs (6)
1434
=> new
VirtualFileResult
(virtualPath, contentType) { FileDownloadName = fileDownloadName };
1450
=> new
VirtualFileResult
(virtualPath, contentType)
1470
return new
VirtualFileResult
(virtualPath, contentType)
1492
return new
VirtualFileResult
(virtualPath, contentType)
1515
return new
VirtualFileResult
(virtualPath, contentType)
1539
return new
VirtualFileResult
(virtualPath, contentType)
Microsoft.AspNetCore.Mvc.Core.Test (5)
VirtualFileResultTest.cs (5)
26
var result = new
VirtualFileResult
(path, "text/plain");
41
var result = new
VirtualFileResult
(path, contentType);
55
var result = new
VirtualFileResult
("some-path", "text/plain");
72
var result = new
VirtualFileResult
("some-path", "text/plain") { FileProvider = fileProvider };
91
var result = new
VirtualFileResult
(path, contentType)
Microsoft.AspNetCore.Mvc.RazorPages (2)
PageBase.cs (1)
378
=> new
VirtualFileResult
(virtualPath, contentType) { FileDownloadName = fileDownloadName };
PageModel.cs (1)
710
=> new
VirtualFileResult
(virtualPath, contentType) { FileDownloadName = fileDownloadName };
49 references to VirtualFileResult
FilesWebSite (1)
Controllers\EmbeddedFilesController.cs (1)
33
var
file = new VirtualFileResult("/Greetings.txt", "text/plain")
Microsoft.AspNetCore.Mvc.Core (26)
ControllerBase.cs (16)
1402
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1404
public virtual
VirtualFileResult
File(string virtualPath, string contentType)
1416
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1418
public virtual
VirtualFileResult
File(string virtualPath, string contentType, bool enableRangeProcessing)
1431
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1433
public virtual
VirtualFileResult
File(string virtualPath, string contentType, string? fileDownloadName)
1447
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1449
public virtual
VirtualFileResult
File(string virtualPath, string contentType, string? fileDownloadName, bool enableRangeProcessing)
1466
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1468
public virtual
VirtualFileResult
File(string virtualPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag)
1488
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1490
public virtual
VirtualFileResult
File(string virtualPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing)
1511
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1513
public virtual
VirtualFileResult
File(string virtualPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag)
1535
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
1537
public virtual
VirtualFileResult
File(string virtualPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (1)
237
services.TryAddSingleton<IActionResultExecutor<
VirtualFileResult
>, VirtualFileResultExecutor>();
Infrastructure\VirtualFileResultExecutor.cs (6)
14
/// A <see cref="IActionResultExecutor{VirtualFileResult}"/> for <see cref="
VirtualFileResult
"/>.
16
public partial class VirtualFileResultExecutor : FileResultExecutorBase, IActionResultExecutor<
VirtualFileResult
>
34
public virtual Task ExecuteAsync(ActionContext context,
VirtualFileResult
result)
66
protected virtual Task WriteFileAsync(ActionContext context,
VirtualFileResult
result, IFileInfo fileInfo, RangeItemHeaderValue? range, long rangeLength)
105
internal static IFileInfo GetFileInformation(
VirtualFileResult
result, IWebHostEnvironment hostingEnvironment)
123
internal static IFileProvider GetFileProvider(
VirtualFileResult
result, IWebHostEnvironment hostingEnvironment)
VirtualFileResult.cs (3)
21
/// Creates a new <see cref="
VirtualFileResult
"/> instance with the provided <paramref name="fileName"/>
32
/// Creates a new <see cref="
VirtualFileResult
"/> instance with
64
var executor = context.HttpContext.RequestServices.GetRequiredService<IActionResultExecutor<
VirtualFileResult
>>();
Microsoft.AspNetCore.Mvc.Core.Test (10)
ControllerBaseTest.cs (4)
1776
var
result = controller.File(path, "application/pdf");
1800
var
result = controller.File(path, "application/pdf", lastModified, entityTag, enableRangeProcessing);
1820
var
result = controller.File(path, "application/pdf", "someDownloadName");
1844
var
result = controller.File(path, "application/pdf", "someDownloadName", lastModified, entityTag, enableRangeProcessing);
VirtualFileResultTest.cs (6)
26
var
result = new VirtualFileResult(path, "text/plain");
41
var
result = new VirtualFileResult(path, contentType);
55
var
result = new VirtualFileResult("some-path", "text/plain");
72
var
result = new VirtualFileResult("some-path", "text/plain") { FileProvider = fileProvider };
86
.AddTransient<IActionResultExecutor<
VirtualFileResult
>, VirtualFileResultExecutor>()
91
var
result = new VirtualFileResult(path, contentType)
Microsoft.AspNetCore.Mvc.RazorPages (8)
PageBase.cs (4)
364
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
365
public virtual
VirtualFileResult
File(string virtualPath, string contentType)
376
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
377
public virtual
VirtualFileResult
File(string virtualPath, string contentType, string? fileDownloadName)
PageModel.cs (4)
696
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
697
public virtual
VirtualFileResult
File(string virtualPath, string contentType)
708
/// <returns>The created <see cref="
VirtualFileResult
"/> for the response.</returns>
709
public virtual
VirtualFileResult
File(string virtualPath, string contentType, string? fileDownloadName)
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
PageModelTest.cs (2)
1413
var
result = pageModel.File(path, "application/pdf");
1430
var
result = pageModel.File(path, "application/pdf", "someDownloadName");
PageTest.cs (2)
1403
var
result = page.File(path, "application/pdf");
1420
var
result = page.File(path, "application/pdf", "someDownloadName");