// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Mvc
{
///
/// Represents an that when executed will
/// write a file as the response.
///
public abstract class FileResult : ActionResult
{
private string _fileDownloadName;
///
/// Creates a new instance with
/// the provided .
///
/// The Content-Type header of the response.
protected FileResult(string contentType)
{
if (contentType == null)
{
throw new ArgumentNullException(nameof(contentType));
}
ContentType = contentType;
}
///
/// Gets the Content-Type header for the response.
///
public string ContentType { get; }
///
/// Gets the file name that will be used in the Content-Disposition header of the response.
///
public string FileDownloadName
{
get { return _fileDownloadName ?? string.Empty; }
set { _fileDownloadName = value; }
}
///
/// Gets or sets the last modified information associated with the .
///
public DateTimeOffset? LastModified { get; set; }
///
/// Gets or sets the etag associated with the .
///
public EntityTagHeaderValue EntityTag { get; set; }
///
/// Gets or sets the value that enables range processing for the .
///
public bool EnableRangeProcessing { get; set; }
}
}