using System; using System.Collections.Generic; using System.Text; namespace Blog3000.Shared { public class BlogPostHeader { public string Id { get; set; } public string Access { get; set; } public string Lang { get; set; } public bool NoSocialMediaInfo { get; set; } public string Title { get; set; } public string Author { get; set; } /// /// Category = storage the path | separated /// not used ATM /// public string Category { get; set; } public string Filename { get; set; } public List Topics { get; set; } public List Revisions { get; set; } public string Abstract { get; set; } public string Checksum { get; set; } public int? StickyMenuPos { get; set; } public Dictionary ImageRefs { get; set; } public static bool IsUsable(BlogPostHeader p) { return !String.IsNullOrEmpty(p.Filename) && !String.IsNullOrEmpty(p.Id) && !String.IsNullOrEmpty(p.Title) && !String.IsNullOrEmpty(p.Author); } protected static T FromI(BlogPostHeader p) where T: BlogPostHeader, new() { var res = new T() { Id = p.Id, Category = p.Category, Filename = p.Filename, Author = p.Author, Abstract = p.Abstract, Access = p.Access, Checksum = p.Checksum, Revisions = p.Revisions, Title = p.Title, Topics = p.Topics, ImageRefs = p.ImageRefs, StickyMenuPos = p.StickyMenuPos }; return res; } } }