Add Property Computed from Content
Its possible to have a Summary contain a property computed from a property or properties on the main Content type. Â For instance, a count of items in a list, or a flag saying whether a value is empty. Â This is done simply by adding the computed property with an empty Set method on the Content type, then adding a normal default property with the same name on the Summary type, like this:
[Serializable] public class TestSummary : Summary { public int SubTestsCount { get; set; } } Â [Serializable, SummaryType(typeof(TestSummary))] public class TestContent : BaseContent { public List<SubTest> SubTests { get; set; } Â public int SubTestsCount { get { return SubTests == null ? 0 : SubTests.Count; } set { } } Â public TestContent() { SubTests = new List<SubTest>(); } }