using System.Collections.Generic; namespace Website { public class Content : IContent { protected readonly Dictionary _metaData = new Dictionary(); private int _id; public int ID { get { return _id; } set { _id = value; } } public string PageName { get; set; } public string Text { get; set; } public string Title { get; set; } #region Constructors public Content() : this(default(int), string.Empty, null) { } public Content(int id, string text) : this(default(int), text, null) { } public Content(int id, string text, Dictionary metaData) { _id = id; Text = text; _metaData = metaData ?? new Dictionary(); } #endregion public T GetMetaData(string key) { return Parse.To(_metaData[key]); } public string this[string key] { get { return _metaData.ContainsKey(key) ? _metaData[key] : string.Empty; } set { _metaData[key] = value; } } } }