using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Org.BouncyCastle.Crypto.Modes; namespace Yavsc.Models.Blog { public class UploadedFile { /// /// File Identifier /// /// [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Display(Name = "Identifiant du fichier")] public long Id { get; set; } /// /// relative path to the file, relative to the poster space prefix /// /// public string Path { get; set; } /// /// Length /// /// /// /// public long Length { get; set; } /// /// File Content type /// /// public string ContentType { get; set; } } public class BlogAttachedFile { /// /// Post Id /// /// public long FileId { get; set; } [ForeignKey("FileId")] public virtual UploadedFile File { get; set; } /// /// Post Id /// /// public long PostId { get; set; } [ForeignKey("PostId")] public virtual BlogPost Post { get; set; } } }