using System;
using System.ComponentModel.DataAnnotations.Schema;
using Oqtane.Shared;
namespace Oqtane.Models
{
///
/// Describes a File in Oqtane
///
public class File : IAuditable
{
///
/// 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; }
#region IAuditable Properties
///
public string CreatedBy { get; set; }
///
public DateTime CreatedOn { get; set; }
///
public string ModifiedBy { get; set; }
///
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet
public string DeletedBy { get; set; }
public DateTime? DeletedOn { get; set; }
public bool IsDeleted { get; set; }
#endregion
///
/// 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; }
}
}