Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

Quick Watch on an Orchard.ContentManagement.ContentItem

Tags: orchard-cms, visual-studio, c#

This is what you’ll see in the top level of the Watch window. I find the yellow ones useful.

NewsItem

  • base Duplicates MyContentItem.
  • _parts Duplicate Parts.
  • ContentManager
  • ContentType A string that names the content type. E.g. “NewsItem”
  • Id
  • Orchard.ContentManagement.IContent.ContentItem Duplicates MyContentItem.
  • Parts Contains all the parts that are attached to this ContentType.
    • [0]
      • PartDefinition ContentPart`1
    • [1]
      • PartDefinition FieldIndexPart
    • [2]
      • PartDefinition TitlePart
    • [3]
      • PartDefinition BodyPart
    • [4]
      • PartDefinition CommonPart
    • [5]
      • PartDefinition NewsItem
    • [0]
      • PartDefinition AutoroutePart
    • [0]
      • PartDefinition InfosetPart
  • Record
  • TypeDefinition
    • DisplayName
    • Name
    • Parts
      • [0]
        • PartDefinition
          • Fields Count = 0
          • Name TitlePart
          • Settings
      • [1]
        • PartDefinition
          • Fields Count = 0
          • Name BodyPart
          • Settings
      • [2]
        • PartDefinition
          • Fields Count = 0
          • Name CommonPart
          • Settings
      • [3]
        • PartDefinition
          • Fields Count = 5 (this has fields because the Part has the same name as the Type).
            •  
            •  
            •  
            •  
            •  
          • Name NewsItem
          • Settings
      • [4]
        • PartDefinition
          • Fields Count = 0
          • Name AutoroutePart
          • Settings
  • Version
  • VersionRecord
  • Dynamic View

Questions

  1. What is the type of the Parts property? It appears to be a List of some sort.
  2. What is the difference between MyContentItem.Parts and MyContentItem.TypeDefinition.Parts? The former often lists more parts than the latter does.

Resources

http://msdn.microsoft.com/en-us/library/hfw7t1ce%28v=vs.71%29.aspx