Skip to content

Commit 580737e

Browse files
committed
Fix few snippet related issues with docs
1 parent 0d26c6e commit 580737e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+519
-478
lines changed

docs/guide/basics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ something happened. Just know that as far as Wolverine is concerned, those are r
1010
Here's a couple simple samples:
1111

1212
<!-- snippet: sample_DebutAccount_command -->
13-
<a id='snippet-sample_debutaccount_command'></a>
13+
<a id='snippet-sample_DebutAccount_command'></a>
1414
```cs
1515
// A "command" message
1616
public record DebitAccount(long AccountId, decimal Amount);
1717

1818
// An "event" message
1919
public record AccountOverdrawn(long AccountId);
2020
```
21-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/DocumentationSamples/MessageBusBasics.cs#L76-L84' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_debutaccount_command' title='Start of snippet'>anchor</a></sup>
21+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/DocumentationSamples/MessageBusBasics.cs#L76-L84' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_DebutAccount_command' title='Start of snippet'>anchor</a></sup>
2222
<!-- endSnippet -->
2323

2424
The next concept in Wolverine is a message handler, which is just a method that "knows" how to process an incoming message. Here's an extremely
2525
simple example:
2626

2727
<!-- snippet: sample_DebitAccountHandler -->
28-
<a id='snippet-sample_debitaccounthandler'></a>
28+
<a id='snippet-sample_DebitAccountHandler'></a>
2929
```cs
3030
public static class DebitAccountHandler
3131
{
@@ -35,7 +35,7 @@ public static class DebitAccountHandler
3535
}
3636
}
3737
```
38-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/DocumentationSamples/MessageBusBasics.cs#L64-L74' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_debitaccounthandler' title='Start of snippet'>anchor</a></sup>
38+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/DocumentationSamples/MessageBusBasics.cs#L64-L74' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_DebitAccountHandler' title='Start of snippet'>anchor</a></sup>
3939
<!-- endSnippet -->
4040

4141
Wolverine can act as a completely local mediator tool that allows your code to invoke the handler for a message at any time without having

docs/guide/codegen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ As of Wolverine 5.0, you now have the ability to better control the usage of the
203203
code generation to potentially avoid unwanted usage:
204204

205205
<!-- snippet: sample_configuring_ServiceLocationPolicy -->
206-
<a id='snippet-sample_configuring_servicelocationpolicy'></a>
206+
<a id='snippet-sample_configuring_ServiceLocationPolicy'></a>
207207
```cs
208208
var builder = Host.CreateApplicationBuilder();
209209
builder.UseWolverine(opts =>
@@ -225,7 +225,7 @@ builder.UseWolverine(opts =>
225225
opts.ServiceLocationPolicy = ServiceLocationPolicy.NotAllowed;
226226
});
227227
```
228-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/DocumentationSamples/ServiceLocationUsage.cs#L11-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_configuring_servicelocationpolicy' title='Start of snippet'>anchor</a></sup>
228+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/DocumentationSamples/ServiceLocationUsage.cs#L11-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_configuring_ServiceLocationPolicy' title='Start of snippet'>anchor</a></sup>
229229
<!-- endSnippet -->
230230

231231
::: note
@@ -370,7 +370,7 @@ and you can configure different behavior for production versus development time
370370
using var host = await Host.CreateDefaultBuilder()
371371
.UseWolverine(opts =>
372372
{
373-
// Use "Dynamic" type load mode at development time, but
373+
// Use "Auto" type load mode at development time, but
374374
// "Static" any other time
375375
opts.Services.CritterStackDefaults(x =>
376376
{

docs/guide/command-line.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tools. To get started, apply Oakton as the command line parser in your applicati
77
sample application bootstrapping from Wolverine's [Getting Started](/tutorials/getting-started):
88

99
<!-- snippet: sample_Quickstart_Program -->
10-
<a id='snippet-sample_quickstart_program'></a>
10+
<a id='snippet-sample_Quickstart_Program'></a>
1111
```cs
1212
using JasperFx;
1313
using Quickstart;
@@ -49,7 +49,7 @@ app.MapGet("/", () => Results.Redirect("/swagger"));
4949
// your Wolverine application
5050
return await app.RunJasperFxCommands(args);
5151
```
52-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Quickstart/Program.cs#L1-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_quickstart_program' title='Start of snippet'>anchor</a></sup>
52+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Quickstart/Program.cs#L1-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_Quickstart_Program' title='Start of snippet'>anchor</a></sup>
5353
<!-- endSnippet -->
5454

5555
From this project's root in the command line terminal tool of your choice, type:

docs/guide/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Below is a sample of adding Wolverine to an ASP.NET Core application that is boo
3030
`WebApplicationBuilder`:
3131

3232
<!-- snippet: sample_Quickstart_Program -->
33-
<a id='snippet-sample_quickstart_program'></a>
33+
<a id='snippet-sample_Quickstart_Program'></a>
3434
```cs
3535
using JasperFx;
3636
using Quickstart;
@@ -72,7 +72,7 @@ app.MapGet("/", () => Results.Redirect("/swagger"));
7272
// your Wolverine application
7373
return await app.RunJasperFxCommands(args);
7474
```
75-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Quickstart/Program.cs#L1-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_quickstart_program' title='Start of snippet'>anchor</a></sup>
75+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Quickstart/Program.cs#L1-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_Quickstart_Program' title='Start of snippet'>anchor</a></sup>
7676
<!-- endSnippet -->
7777

7878
## "Headless" Applications

docs/guide/diagnostics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ to utilize this command line integration, you need to apply JasperFx as your com
99
sample `Program.cs` file:
1010

1111
<!-- snippet: sample_Quickstart_Program -->
12-
<a id='snippet-sample_quickstart_program'></a>
12+
<a id='snippet-sample_Quickstart_Program'></a>
1313
```cs
1414
using JasperFx;
1515
using Quickstart;
@@ -51,7 +51,7 @@ app.MapGet("/", () => Results.Redirect("/swagger"));
5151
// your Wolverine application
5252
return await app.RunJasperFxCommands(args);
5353
```
54-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Quickstart/Program.cs#L1-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_quickstart_program' title='Start of snippet'>anchor</a></sup>
54+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Quickstart/Program.cs#L1-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_Quickstart_Program' title='Start of snippet'>anchor</a></sup>
5555
<!-- endSnippet -->
5656

5757
## Command Line Description

docs/guide/durability/efcore/multi-tenancy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Then you can _still_ use those EF Core `DbContext` services with Wolverine messa
173173
this sample code:
174174

175175
<!-- snippet: sample_using_IDbContextOutboxFactory -->
176-
<a id='snippet-sample_using_idbcontextoutboxfactory'></a>
176+
<a id='snippet-sample_using_IDbContextOutboxFactory'></a>
177177
```cs
178178
public class MyMessageHandler
179179
{
@@ -203,7 +203,7 @@ public class MyMessageHandler
203203
}
204204
}
205205
```
206-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Persistence/EfCoreTests/MultiTenancy/MultiTenancyDocumentationSamples.cs#L190-L220' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_using_idbcontextoutboxfactory' title='Start of snippet'>anchor</a></sup>
206+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Persistence/EfCoreTests/MultiTenancy/MultiTenancyDocumentationSamples.cs#L190-L220' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_using_IDbContextOutboxFactory' title='Start of snippet'>anchor</a></sup>
207207
<!-- endSnippet -->
208208

209209
The important thing to note above is just that this pattern and service will work with any .NET code and not just within Wolverine

docs/guide/durability/efcore/operations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Just know that Wolverine completely supports the concept of [Storage Operations]
55
Assuming you have an EF Core `DbContext` type like this registered in your system:
66

77
<!-- snippet: sample_TodoDbContext -->
8-
<a id='snippet-sample_tododbcontext'></a>
8+
<a id='snippet-sample_TodoDbContext'></a>
99
```cs
1010
public class TodoDbContext : DbContext
1111
{
@@ -27,14 +27,14 @@ public class TodoDbContext : DbContext
2727
}
2828
}
2929
```
30-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Persistence/EfCoreTests/using_storage_return_types_and_entity_attributes.cs#L55-L77' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_tododbcontext' title='Start of snippet'>anchor</a></sup>
30+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Persistence/EfCoreTests/using_storage_return_types_and_entity_attributes.cs#L55-L77' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_TodoDbContext' title='Start of snippet'>anchor</a></sup>
3131
<!-- endSnippet -->
3232

3333
You can use storage operations in Wolverine message handlers or HTTP endpoints like these samples from the Wolverine
3434
test suite:
3535

3636
<!-- snippet: sample_TodoHandler_to_demonstrate_storage_operations -->
37-
<a id='snippet-sample_todohandler_to_demonstrate_storage_operations'></a>
37+
<a id='snippet-sample_TodoHandler_to_demonstrate_storage_operations'></a>
3838
```cs
3939
public static class TodoHandler
4040
{
@@ -134,7 +134,7 @@ public static class TodoHandler
134134
}
135135
}
136136
```
137-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Testing/Wolverine.ComplianceTests/StorageActionCompliance.cs#L294-L394' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_todohandler_to_demonstrate_storage_operations' title='Start of snippet'>anchor</a></sup>
137+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Testing/Wolverine.ComplianceTests/StorageActionCompliance.cs#L294-L394' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_TodoHandler_to_demonstrate_storage_operations' title='Start of snippet'>anchor</a></sup>
138138
<!-- endSnippet -->
139139

140140
::: warning

docs/guide/durability/efcore/sagas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class Order : Saga
9292
And a matching `OrdersDbContext` that can persist that type like so:
9393

9494
<!-- snippet: sample_OrdersDbContext -->
95-
<a id='snippet-sample_ordersdbcontext'></a>
95+
<a id='snippet-sample_OrdersDbContext'></a>
9696
```cs
9797
public class OrdersDbContext : DbContext
9898
{
@@ -119,7 +119,7 @@ public class OrdersDbContext : DbContext
119119
}
120120
}
121121
```
122-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/EFCoreSample/ItemService/Orders/Order.cs#L81-L108' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_ordersdbcontext' title='Start of snippet'>anchor</a></sup>
122+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/EFCoreSample/ItemService/Orders/Order.cs#L81-L108' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_OrdersDbContext' title='Start of snippet'>anchor</a></sup>
123123
<!-- endSnippet -->
124124

125125
There's no other registration to do other than adding the `OrdersDbContext` to your IoC container and enabling

docs/guide/durability/idempotency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Instead of immediately deleting message storage for a successfully completed mes
1414
that message in storage for a default of 5 minutes to protect against duplicate incoming messages. To override that setting, you have this option:
1515

1616
<!-- snippet: sample_configuring_KeepAfterMessageHandling -->
17-
<a id='snippet-sample_configuring_keepaftermessagehandling'></a>
17+
<a id='snippet-sample_configuring_KeepAfterMessageHandling'></a>
1818
```cs
1919
using var host = await Host.CreateDefaultBuilder()
2020
.UseWolverine(opts =>
@@ -25,5 +25,5 @@ using var host = await Host.CreateDefaultBuilder()
2525
opts.Durability.KeepAfterMessageHandling = 10.Minutes();
2626
}).StartAsync();
2727
```
28-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Persistence/PersistenceTests/Samples/DocumentationSamples.cs#L195-L206' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_configuring_keepaftermessagehandling' title='Start of snippet'>anchor</a></sup>
28+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Persistence/PersistenceTests/Samples/DocumentationSamples.cs#L195-L206' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_configuring_KeepAfterMessageHandling' title='Start of snippet'>anchor</a></sup>
2929
<!-- endSnippet -->

docs/guide/durability/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ getting lost en route.
2727
Consider this sample message handler from Wolverine's [AppWithMiddleware sample project](https://github.com/JasperFx/wolverine/tree/main/src/Samples/Middleware):
2828

2929
<!-- snippet: sample_DebitAccountHandler_that_uses_IMessageContext -->
30-
<a id='snippet-sample_debitaccounthandler_that_uses_imessagecontext'></a>
30+
<a id='snippet-sample_DebitAccountHandler_that_uses_IMessageContext'></a>
3131
```cs
3232
[Transactional]
3333
public static async Task Handle(
@@ -62,7 +62,7 @@ public static async Task Handle(
6262
new DeliveryOptions { DeliverWithin = 5.Seconds() });
6363
}
6464
```
65-
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Middleware/AppWithMiddleware/Account.cs#L126-L161' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_debitaccounthandler_that_uses_imessagecontext' title='Start of snippet'>anchor</a></sup>
65+
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Samples/Middleware/AppWithMiddleware/Account.cs#L126-L161' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_DebitAccountHandler_that_uses_IMessageContext' title='Start of snippet'>anchor</a></sup>
6666
<!-- endSnippet -->
6767

6868
The handler code above is committing changes to an `Account` in the underlying database and potentially sending out additional messages based on the state of the `Account`.

0 commit comments

Comments
 (0)