Skip to content

Commit

Permalink
Document AddSegment()
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaliumhexacyanoferrat committed Dec 17, 2024
1 parent 8861f54 commit b019b1e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions content/documentation/content/handlers/layouting.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ await Host.Create()
.RunAsync();
```

### Imperative Flow

Instead of creating and adding new layouts for each sub section yourself, you can also directly create a new layout
by calling the `AddSegment()` method on an existing builder.
This flavor feels more imperative and might suit some project
setup procedures better than the functional one.

```csharp
var app = Layout.Create();

var api = app.AddSegment("api"); // or AddSegments([ "api", "v1" ])
api.AddService<SomeService>("some");
```

## Fallbacks

If a handler cannot provide a response it will return `null` which causes the server
Expand Down

0 comments on commit b019b1e

Please sign in to comment.