PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Model Namespace / Child­Attribute Class / Child­Attribute Properties / Child­Attribute.​Is­Parent­Surrogate Property

ChildAttribute.IsParentSurrogate Property

Determines whether the value assigned to the field or property is a parent surrogate. The Parent property of children of a parent surrogate are set to the parent of the parent surrogate, instead of to the field itself.

Namespace:  PostSharp.Patterns.Model
Assembly:  PostSharp.Patterns.Aggregation (in PostSharp.Patterns.Aggregation.dll) Version: 2023.0.3.0 (2023.0.3.0)
public bool IsParentSurrogate { get; set; }

Property Value

Type: Boolean

When an item is attached to a parent surrogate, the Parent property of the item is set to the Parent of the parent surrogate, instead of the parent surrogate itself. Collections are typical examples of a parent surrogate, because the parent of collection items need to be the owner of the collection and not the collection itself.

The default value of this field is true for collections, and false otherwise.

See Also