using System;
using System.ComponentModel.DataAnnotations.Schema;
using Oqtane.Shared;
namespace Oqtane.Models
{
///
/// Describes a File in Oqtane
///
public class File : ModelBase
{
///
/// ID to identify the file
///
public int FileId { get; set; }
///
/// Reference to the .
/// Use this if you need to determine what the file belongs to.
///
public int FolderId { get; set; }
///
/// Name of the file
/// todo: with extension or not?
///
public string Name { get; set; }
///
/// File name extension like 'jpg'
/// * Always lower case
/// * Without the dot (.)
///
public string Extension { get; set; }
///
/// File size
///
public int Size { get; set; }
///
/// The height of an image (if the file is an image) in pixels.
/// This is calculated at time of Upload, so if the file is manually replaced, the value will be wrong.
///
public int ImageHeight { get; set; }
///
/// The width of an image (if the file is an image) in pixels.
/// This is calculated at time of Upload, so if the file is manually replaced, the value will be wrong.
///
public int ImageWidth { get; set; }
///
/// Description of a file
///
public string Description { get; set; }
///
/// Deprecated
/// Note that this property still exists in the database because columns cannot be dropped in SQLite
/// Therefore the property must be retained/mapped even though the framework no longer uses it
///
public bool? IsDeleted { get; set; }
///
/// Object reference to the object.
/// Use this if you need to determine what the file belongs to.
/// TODO: not sure if this is always populated, must verify and document
///
public Folder Folder { get; set; }
///
/// url for accessing file
///
[NotMapped]
public string Url { get; set; }
}
}