Skip to content

object properties

vijay@envivo edited this page Oct 27, 2026 · 10 revisions

Object Properties

These properties contain references to other objects. The UI allows a property to accept another object only if the types are compatible.

Declaring the type of relationship is important at this stage, as it describes lifetimes between objects. This is especially important when designing Aggregate Roots.

Consider two objects, A and B. The relationship type may be defined as:

Relationship Type Description
Has (aka "Aggregation") Object A is linked to B.
If A is removed, B remains intact.
Owns (aka "Composition") Object A owns B.
If A is removed, B would no longer exist.
Owned By (aka "Parent") Object A is owned by B.
Needed for bidirectional references between the objects

In code, these relationship types are declared using the Relationship attribute, like so:

[Relationship(RelationshipType.Has)] //👈
public Product Product { get; set; }

Setting properties using the UI

The Relationship Type drives how you interact with properties:

"Owns" relationship type

Only new objects can be assigned to the property (objects can only have one owner, and the property's parent is the owner). In the UI, use the Create option on the property:

"Has" relationship type

Only existing objects can be assigned to the property (as those objects are typically owned by another parent). In the UI, use the Associate with option on the property:

The UI only allows a selection from an existing set of objects, so you need to declare the query that will provide that set. See the Queries and Filters and Query Specifications sections for more information.

"Owned By" relationship type

This property cannot be set by the UI. Typically this property is set within code, and merely displayed in the UI for navigation purposes:

💡 Developer Tips

  • When adding a reference to an Aggregate Root, you may need an intermediary Aggregate Reference. See the Aggregate References section for more information.

Clone this wiki locally