Shuttle.Recall
20.0.0
Prefix Reserved
See the version list below for details.
dotnet add package Shuttle.Recall --version 20.0.0
NuGet\Install-Package Shuttle.Recall -Version 20.0.0
<PackageReference Include="Shuttle.Recall" Version="20.0.0" />
<PackageVersion Include="Shuttle.Recall" Version="20.0.0" />
<PackageReference Include="Shuttle.Recall" />
paket add Shuttle.Recall --version 20.0.0
#r "nuget: Shuttle.Recall, 20.0.0"
#:package Shuttle.Recall@20.0.0
#addin nuget:?package=Shuttle.Recall&version=20.0.0
#tool nuget:?package=Shuttle.Recall&version=20.0.0
Shuttle.Recall
A .Net event-sourcing mechanism.
Documentation
If you would like to give Shuttle.Recall a spin you can head over to our documentation site.
Getting Started
This guide demonstrates using Shuttle.Recall with a Sql Server implementation.
Start a new Console Application project called RecallQuickstart and select a Shuttle.Recall implementation:
PM> Install-Package Shuttle.Recall.Sql.Storage
This provides a SQL-based store for doamin events.
Install the
System.Data.SqlClientnuget package.
This will provide a connection to our Sql Server.
Now we'll define the domain event that will represent a state change in the Name attribute:
public class Renamed
{
public string Name { get; set; }
}
Next we'll create our Aggregate Root. In a real-world scenario the aggregate in our domain would be something like Customer, Member, Invoice, and so forth. The aggregate will make use of an EventStream to save the changes in the state:
using System;
using System.Collections.Generic;
namespace RecallQuickstart
{
public class AggregateRoot
{
public Guid Id { get; }
public string Name { get; private set; }
public List<string> AllNames { get; } = new List<string>();
public AggregateRoot(Guid id)
{
Id = id;
}
public Renamed Rename(string name)
{
return On(new Renamed
{
Name = name
});
}
private Renamed On(Renamed renamed)
{
Name = renamed.Name;
AllNames.Add(Name);
return renamed;
}
}
}
Create a new Sql Server database called RecallQuickstart to store our events and execute the following creation script against that database:
%userprofile%\.nuget\packages\shuttle.recall.sql.storage\{version}\scripts\System.Data.SqlClient\EventStoreCreate.sql
Next we'll use event sourcing to store an rehydrate our aggregate root from the Main() entry point:
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Extensions.DependencyInjection;
using Shuttle.Core.Data;
using Shuttle.Recall;
using Shuttle.Recall.Sql.Storage;
namespace RecallQuickstart
{
internal class Program
{
static void Main(string[] args)
{
DbProviderFactories.RegisterFactory("System.Data.SqlClient", SqlClientFactory.Instance);
var services = new ServiceCollection();
services
.AddDataAccess(builder =>
{
builder.AddConnectionString("EventStore", "System.Data.SqlClient",
"Data Source=.;Initial Catalog=RecallQuickstart;user id=sa;password=Pass!000");
builder.Options.DatabaseContextFactory.DefaultConnectionStringName = "EventStore";
})
.AddSqlEventStorage()
.AddEventStore();
var provider = services.BuildServiceProvider();
var databaseContextFactory = provider.GetRequiredService<IDatabaseContextFactory>();
var store = provider.GetRequiredService<IEventStore>();
var id = Guid.NewGuid();
// we can very easily also add unit tests for our aggregate in a separate project... done here as an example
var aggregateRoot1 = new AggregateRoot(id);
var stream1 = store.CreateEventStream(id);
stream1.AddEvent(aggregateRoot1.Rename("Name-1"));
stream1.AddEvent(aggregateRoot1.Rename("Name-2"));
stream1.AddEvent(aggregateRoot1.Rename("Name-3"));
stream1.AddEvent(aggregateRoot1.Rename("Name-4"));
stream1.AddEvent(aggregateRoot1.Rename("Name-5"));
if (aggregateRoot1.AllNames.Count != 5)
{
throw new ApplicationException();
}
if (!aggregateRoot1.Name.Equals("Name-5"))
{
throw new ApplicationException();
}
using (databaseContextFactory.Create("EventStore"))
{
store.Save(stream1);
}
var aggregateRoot2 = new AggregateRoot(id);
EventStream stream2;
using (databaseContextFactory.Create("EventStore"))
{
stream2 = store.Get(id);
}
stream2.Apply(aggregateRoot2);
if (aggregateRoot2.AllNames.Count != 5)
{
throw new ApplicationException();
}
if (!aggregateRoot2.Name.Equals("Name-5"))
{
throw new ApplicationException();
}
}
}
}
Once you have executed the program you'll find the 5 relevant entries in the EventStore table in the database.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Shuttle.Core.Compression (>= 20.0.0)
- Shuttle.Core.Contract (>= 20.0.0)
- Shuttle.Core.Encryption (>= 20.0.0)
- Shuttle.Core.Pipelines (>= 20.0.0)
- Shuttle.Core.PipelineTransactionScope (>= 20.0.0)
- Shuttle.Core.Reflection (>= 20.0.0)
- Shuttle.Core.Serialization (>= 20.0.0)
- Shuttle.Core.Specification (>= 20.0.0)
- Shuttle.Core.Streams (>= 20.0.0)
- Shuttle.Core.Threading (>= 20.0.0)
NuGet packages (11)
Showing the top 5 NuGet packages that depend on Shuttle.Recall:
| Package | Downloads |
|---|---|
|
Shuttle.Recall.Sql.Storage
Sql-based implementation of the event store Shuttle.Recall persistence interfaces. |
|
|
Shuttle.Esb.Process
Shuttle.Esb process management using Shuttle.Recall event sourcing. |
|
|
Shuttle.Recall.Tests
Tests to exercise Shuttle.Recall component implementations. |
|
|
Shuttle.Recall.Sql.EventProcessing
Sql-based implementation of the event store Shuttle.Recall projection interfaces. |
|
|
Shuttle.Access.Sql
Provides Sql-based implementation of data access components for use with Shuttle.Access implementations. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 21.0.0-alpha | 25 | 1/18/2026 |
| 20.0.0 | 1,892 | 2/2/2025 |
| 18.0.0 | 546 | 8/5/2024 |
| 17.0.1 | 589 | 5/3/2024 |
| 17.0.0 | 573 | 4/30/2024 |
| 16.1.1 | 3,926 | 12/1/2022 |
| 16.0.0 | 4,151 | 9/4/2022 |
| 14.0.0 | 3,222 | 5/29/2022 |
| 13.1.0 | 2,891 | 5/6/2022 |
| 13.0.1 | 4,575 | 4/9/2022 |
| 13.0.0 | 3,111 | 3/21/2022 |
| 12.0.5 | 703 | 1/22/2022 |
| 12.0.3 | 3,256 | 2/4/2021 |
| 12.0.2 | 1,272 | 1/17/2021 |
| 12.0.1 | 2,222 | 11/8/2020 |
| 11.1.0 | 1,742 | 9/1/2020 |
| 11.0.0 | 2,374 | 8/21/2019 |
| 10.2.1 | 4,219 | 5/27/2019 |
| 10.1.4 | 1,143 | 9/22/2018 |
| 10.1.3 | 3,311 | 9/16/2018 |
| 10.0.3 | 1,879 | 8/7/2018 |
| 10.0.2 | 1,588 | 7/8/2018 |
| 10.0.0 | 4,954 | 2/13/2018 |
| 8.2.2 | 3,414 | 8/6/2017 |
| 8.2.1 | 4,062 | 7/2/2017 |
| 8.1.3 | 2,970 | 7/1/2017 |
| 8.0.1 | 1,409 | 5/15/2017 |
| 8.0.0 | 2,708 | 3/24/2017 |
| 4.0.0 | 1,482 | 10/2/2016 |
| 3.6.2 | 2,718 | 6/4/2016 |
| 3.6.1 | 1,430 | 6/4/2016 |
| 3.6.0 | 1,474 | 5/18/2016 |
| 3.5.2 | 3,098 | 4/23/2016 |
| 3.5.1 | 3,425 | 3/23/2016 |