Source

DanTup Blog / DanTup Blog / Models / Post.cs

Full commit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace DTuppeny.Blog.Models
{
	/// <summary>
	/// Represents a single post/article on the blog.
	/// </summary>
	public class Post
	{
		/// <summary>
		/// The primary key for this post.
		/// </summary>
		public int ID { get; set; }

		/// <summary>
		/// The title of this post, used in hyperlinks to this post and the title of the page.
		/// </summary>
		public string Title { get; set; }

		/// <summary>
		/// The primary URI for this post, relative to the domain root (eg. "/2011/05/building-a-new-blog").
		/// The URI is case-sensitive, so if the incoming case does not match, a 301 redirect will be performed.
		/// </summary>
		public string Uri { get; set; }

		/// <summary>
		/// A collection of URIs that will redirect (using a 301) to this post using the primary URI. This is to support
		/// URIs changing, or shorter URIs being created.
		/// </summary>
		public virtual ICollection<PostRedirect> Redirects { get; set; }

		/// <summary>
		/// Whether or not this post is live (and therefore, visible to the public). If not, only site administrators
		/// will be able to see the post.
		/// </summary>
		public bool Live { get; set; }

		/// <summary>
		/// The date/time that this post was first created. For flexibility, this value is editable, but generally it
		/// should not be changed.
		/// </summary>
		public DateTime Created { get; set; }

		/// <summary>
		/// The date/time that this post was last modified. This will be identical to the Created property if the post
		/// has never been modified.
		/// </summary>
		public DateTime Modified { get; set; }

		/// <summary>
		/// The body text for this post, in Markdown format. This property should not contain raw HTML unless really
		/// necessary. Any HTML must be valid to be run through the configured Markdown transformer.
		/// </summary>
		[MaxLength]
		public string Body { get; set; }

		/// <summary>
		/// A collection of the tags that this post has been assigned to.
		/// </summary>
		public virtual ICollection<Tag> Tags { get; set; }
	}
}