Skip to content

Commit

Permalink
Add a sample code for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticmind committed Dec 3, 2023
1 parent c9a9d7c commit fd96fc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/schema/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,9 @@ In some cases where you load a specific extension like [PostGIS](https://postgis
Marten provides a mechanism via `DocumentStore.Advanced` to invoke `ReloadTypes()` as needed as per the use case at hand. `store.Advanced.ReloadTypes()` will run this for all tenant databases. There is also a method to run it for a specific tenant database using `Store.Advanced.ReloadTypes(tenanId)`.

<!-- snippet: sample_reload-types -->
<a id='snippet-sample_reload-types'></a>
```cs
await theStore.Advanced.ReloadTypes();
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/DocumentDbTests/Configuration/ability_to_add_custom_pg_type_fetch_data.cs#L23-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_reload-types' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public async Task can_register_a_custom_feature_and_reload_types()
await cmd.ExecuteNonQueryAsync();
}

#region sample_reload-types
await theStore.Advanced.ReloadTypes();
#endregion

await using (var conn = theStore.CreateConnection())
{
Expand Down

0 comments on commit fd96fc5

Please sign in to comment.