Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion DomainEventsWithEfCore/BackLogService/Scraping/Code.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace BackLogService.Scraping;

#region sample_Entity_layer_super_type

// Of course, if you're into DDD, you'll probably
// use many more marker interfaces than I do here,
// but you do you and I'll do me in throwaway sample code
Expand All @@ -21,6 +23,10 @@ public void Publish(object @event)
}
}

#endregion

#region sample_BacklogItem

public class BacklogItem : Entity
{
public Guid Id { get; private set; }
Expand All @@ -36,6 +42,8 @@ public void CommitTo(Sprint sprint)
}
}

#endregion

public class ItemsDbContext : DbContext
{
public DbSet<BacklogItem> BacklogItems { get; set; }
Expand All @@ -44,6 +52,8 @@ public class ItemsDbContext : DbContext

public record CommitToSprint(Guid BacklogItemId, Guid SprintId);

#region sample_CommitToSprintHandler

public static class CommitToSprintHandler
{
public static void Handle(
Expand All @@ -54,7 +64,7 @@ public static void Handle(
// from the incoming command
[Entity] BacklogItem item,
[Entity] Sprint sprint
)
)
{
// This method would cause an event to be published within
// the BacklogItem object here that we need to gather up and
Expand All @@ -66,6 +76,8 @@ [Entity] Sprint sprint
}
}

#endregion

public static class RelayEvents
{
public static async ValueTask PublishEventsAsync(DbContext dbContext, IMessageContext context)
Expand Down
6 changes: 4 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ const config: UserConfig<DefaultTheme.Config> = {
{text: 'Validation', link: '/guide/http/validation'},
{text: 'Fluent Validation', link: '/guide/http/fluentvalidation'},
{text: 'Problem Details', link: '/guide/http/problemdetails'},
{text: 'Caching', link: '/guide/http/caching'}
{text: 'Caching', link: '/guide/http/caching'},
{text: 'HTTP Messaging Transport', link: '/guide/http/transport'}
]
},
{
Expand Down Expand Up @@ -258,7 +259,8 @@ const config: UserConfig<DefaultTheme.Config> = {
{text: 'Transactional Inbox and Outbox', link: '/guide/durability/efcore/outbox-and-inbox'},
{text: 'Operation Side Effects', link: '/guide/durability/efcore/operations'},
{text: 'Saga Storage', link: '/guide/durability/efcore/sagas'},
{text: 'Multi-Tenancy', link: '/guide/durability/efcore/multi-tenancy'}
{text: 'Multi-Tenancy', link: '/guide/durability/efcore/multi-tenancy'},
{text: 'Domain Events', link: '/guide/durability/efcore/domain-events'}

]},
{text: 'Managing Message Storage', link: '/guide/durability/managing'},
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ something happened. Just know that as far as Wolverine is concerned, those are r
Here's a couple simple samples:

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

// An "event" message
public record AccountOverdrawn(long AccountId);
```
<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>
<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>
<!-- endSnippet -->

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
simple example:

<!-- snippet: sample_DebitAccountHandler -->
<a id='snippet-sample_DebitAccountHandler'></a>
<a id='snippet-sample_debitaccounthandler'></a>
```cs
public static class DebitAccountHandler
{
Expand All @@ -35,7 +35,7 @@ public static class DebitAccountHandler
}
}
```
<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>
<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>
<!-- endSnippet -->

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
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ As of Wolverine 5.0, you now have the ability to better control the usage of the
code generation to potentially avoid unwanted usage:

<!-- snippet: sample_configuring_ServiceLocationPolicy -->
<a id='snippet-sample_configuring_ServiceLocationPolicy'></a>
<a id='snippet-sample_configuring_servicelocationpolicy'></a>
```cs
var builder = Host.CreateApplicationBuilder();
builder.UseWolverine(opts =>
Expand All @@ -225,7 +225,7 @@ builder.UseWolverine(opts =>
opts.ServiceLocationPolicy = ServiceLocationPolicy.NotAllowed;
});
```
<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>
<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>
<!-- endSnippet -->

::: note
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tools. To get started, apply Oakton as the command line parser in your applicati
sample application bootstrapping from Wolverine's [Getting Started](/tutorials/getting-started):

<!-- snippet: sample_Quickstart_Program -->
<a id='snippet-sample_Quickstart_Program'></a>
<a id='snippet-sample_quickstart_program'></a>
```cs
using JasperFx;
using Quickstart;
Expand Down Expand Up @@ -49,7 +49,7 @@ app.MapGet("/", () => Results.Redirect("/swagger"));
// your Wolverine application
return await app.RunJasperFxCommands(args);
```
<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>
<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>
<!-- endSnippet -->

From this project's root in the command line terminal tool of your choice, type:
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Below is a sample of adding Wolverine to an ASP.NET Core application that is boo
`WebApplicationBuilder`:

<!-- snippet: sample_Quickstart_Program -->
<a id='snippet-sample_Quickstart_Program'></a>
<a id='snippet-sample_quickstart_program'></a>
```cs
using JasperFx;
using Quickstart;
Expand Down Expand Up @@ -72,7 +72,7 @@ app.MapGet("/", () => Results.Redirect("/swagger"));
// your Wolverine application
return await app.RunJasperFxCommands(args);
```
<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>
<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>
<!-- endSnippet -->

## "Headless" Applications
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ to utilize this command line integration, you need to apply JasperFx as your com
sample `Program.cs` file:

<!-- snippet: sample_Quickstart_Program -->
<a id='snippet-sample_Quickstart_Program'></a>
<a id='snippet-sample_quickstart_program'></a>
```cs
using JasperFx;
using Quickstart;
Expand Down Expand Up @@ -51,7 +51,7 @@ app.MapGet("/", () => Results.Redirect("/swagger"));
// your Wolverine application
return await app.RunJasperFxCommands(args);
```
<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>
<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>
<!-- endSnippet -->

## Command Line Description
Expand Down
3 changes: 1 addition & 2 deletions docs/guide/durability/dead-letter-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ app.MapDeadLettersEndpoints()
// or OpenAPI metadata configuration you need
// for just these endpoints
//.RequireAuthorization("Admin")

;
```
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Http/WolverineWebApi/Program.cs#L202-L212' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_register_dead_letter_endpoints' title='Start of snippet'>anchor</a></sup>
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Http/WolverineWebApi/Program.cs#L202-L213' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_register_dead_letter_endpoints' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

### Using the Dead Letters REST API
Expand Down
Loading
Loading