queries and filters - Envivo-Software/Envivo.Fresnel GitHub Wiki

Queries & Filters

Queries/filters are used in a number of places within a domain. To create a one, follow the steps in the Query Specifications section.

In this example, the SaveableEntityQuerySpecification filter restricts the possible choices when setting the Product property. The FilterQuerySpecification attribute is used to assign the filter to the property:

/// <summary>
/// This object will open a selection dialog
/// </summary>
[Relationship(RelationshipType.Has)]
[FilterQuerySpecification(typeof(SaveableEntityQuerySpecification))]//👈
public SaveableEntity SingleEntityUsingDialog { get; set; }

In the UI, clicking the “Link to another Saveable Entity here” button opens a selection dialog, where the filtered items come from the SaveableEntityQuerySpecification:

Selecting an item then clicking OK will update the property:

You can also use query filters on method parameters using the same technique.

⚠️ **GitHub.com Fallback** ⚠️