model configuration attributes - Envivo-Software/Envivo.Fresnel GitHub Wiki

Inline Configuration Attributes

The quickest way to apply configurations is through the use of Attributes. Attributes can be applied to classes, interfaces, properties, methods, and method parameters, depending on their usage. If your model is constantly being updated and refactored, considering using this technique.

Here are a few examples of attributes being used:

On classes:


[AllowedOperations(canCreate = true)] //👈
public class MyEntity
{
}

On Properties:

[UI(preferredControl = UiControlType.TextArea)] //👈
public string Comments { get; set; }

On Methods:

[Visible(false)]
public void ExecuteAction()
{
    ...
}

On Method Parameters:

public void ExecuteAction(
    [Required] DateTime? actionedAt //👈
)
{
    ...
}

You can find more details in the Configuration Options section.