# Conventions

## Fluent Conventions

Umbraco UI Builder follows a fluent configuration style, allowing method chaining for concise and readable code. Alternatively, a lambda expression can be used for a more structured approach.

### Chaining Example

```csharp
config.AddSection("Repositories")
      .Tree()
      .AddCollection<People>(p => p.Id, "Person", "People");
```

### Lambda Expression Example

```csharp
config.AddSection("Repositories", sectionConfig => {  
    sectionConfig.Tree(treeConfig => {  
        treeConfig.AddCollection<People>(p => p.Id, "Person", "People");  
    });  
});
```

## Naming Conventions

* Methods prefixed with **Add** allow multiple configurations.
* Methods prefixed with **Set** permit only one instance within the current configuration context.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/umbraco-ui-builder/miscellaneous/conventions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
