using Masuit.MyBlogs.Core.Models.Enum;
using Masuit.MyBlogs.Core.Models.Validation;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Masuit.MyBlogs.Core.Models.Entity
{
///
/// 文章历史版本
///
[Table("PostHistoryVersion")]
public class PostHistoryVersion : BaseEntity
{
public PostHistoryVersion()
{
ModifyDate = DateTime.Now;
Status = Status.Pending;
IsWordDocument = false;
Seminar = new HashSet();
}
///
/// 标题
///
[Required, StringLength(128)]
public string Title { get; set; }
///
/// 内容
///
[Required]
public string Content { get; set; }
///
/// 受保护的内容
///
public string ProtectContent { get; set; }
///
/// 浏览次数
///
[DefaultValue(0)]
public int ViewCount { get; set; }
///
/// 修改时间
///
public DateTime ModifyDate { get; set; }
///
/// 分类id
///
[ForeignKey("Category")]
public int CategoryId { get; set; }
///
/// 文章id
///
[ForeignKey("Post")]
public int PostId { get; set; }
///
/// 资源名
///
public string ResourceName { get; set; }
///
/// 是否是Word文档
///
[DefaultValue(false)]
public bool IsWordDocument { get; set; }
///
/// 作者邮箱
///
[StringLength(255), IsEmail]
public string Email { get; set; }
///
/// 标签
///
[StringLength(255)]
public string Label { get; set; }
///
/// 分类
///
public virtual Category Category { get; set; }
///
/// 新文章
///
public virtual Post Post { get; set; }
///
/// 专题
///
public virtual ICollection Seminar { get; set; }
}
}