Summary Class Definition
Below, we show how attributes are used to associate a content data class with its summary class:
[SummaryType(typeof(ArticleSummary))] public class ArticleContent : PageContent, IRelatable, IHasCode { [Summary] public string Code { get; set; } Â [Summary] public string Title { get; set; } Â [Summary] public string Category { get; set; } Â [Summary, UIHint("Multiline")] public string Intro { get; set; } Â public Video Video { get; set; } Â public ArticleContent() { BaseContent.InitialiseProperties(this); } }
ArticleSummary looks like this:
[Serializable] public class ArticleSummary : Summary { public string Code { get; set; } Â public string Category { get; set; }Â Â public string Intro { get; set; } }
Notice that the ArticleSummary contains all the fields marked with the SummaryAttribute in the full content class, except for Title, which exists in the base Summary class already.