Skip to content

Commit

Permalink
V4.0.0/rtm (#28)
Browse files Browse the repository at this point in the history
✨ support for request-id

📝 updated DocFX

⬆️ bump dependencies

💬 updated community health pages
  • Loading branch information
gimlichael authored Nov 13, 2024
1 parent 551b251 commit d943657
Show file tree
Hide file tree
Showing 17 changed files with 310 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Commands
summary: *content
---
The `Savvyio.Commands` namespace holds all the abstractions and core types related to commands (C in Cqrs).

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Data
summary: *content
---
The `Savvyio.Data` namespace holds all the abstractions and core types related to data.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Dispatchers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Dispatchers
summary: *content
---
The `Savvyio.Dispatchers` namespace holds all the abstractions and core types related to dispatchers.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Domain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Domain
summary: *content
---
The `Savvyio.Domain` namespace holds all the abstractions and core types related to DDD.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.EventDriven.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.EventDriven
summary: *content
---
The `Savvyio.EventDriven` namespace holds all the abstractions and core types related to integration events.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
14 changes: 14 additions & 0 deletions .docfx/api/namespaces/Savvyio.Handlers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
uid: Savvyio.Handlers
summary: *content
---
The `Savvyio.Handlers` namespace holds all the abstractions and core types related to handlers.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]

### Extension Methods

|Type|Ext|Methods|
|--:|:-:|---|
|IFireForgetRegistry|⬇️|`RegisterAsync`|
|IRequestReplyRegistry|⬇️|`RegisterAsync`|
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Messaging
summary: *content
---
The `Savvyio.Messaging` namespace holds all the abstractions and core types related to messaging.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Queries
summary: *content
---
The `Savvyio.Queries` namespace holds all the abstractions and core types related to queriying (Q in cQrs).

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
7 changes: 7 additions & 0 deletions .docfx/api/namespaces/Savvyio.Reflection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
uid: Savvyio.Reflection
summary: *content
---
The `Savvyio.Reflection` namespace holds all the abstractions and core types related to reflection.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
15 changes: 15 additions & 0 deletions .docfx/api/namespaces/Savvyio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
uid: Savvyio
summary: *content
---
The `Savvyio` namespace provides the fundamental abstractions and classes for supporting a complete flow of DDD, CQRS and Event Sourcing concepts including the option to scale out using distributed subsystems.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]

### Extension Methods

|Type|Ext|Methods|
|--:|:-:|---|
|IMetadata|⬇️|`GetCausationId`, `GetCorrelationId`, `GetMemberType`, `SetCausationId`, `SetCorrelationId`, `SetEventId`, `SetTimestamp`, `SetMemberType`, `SaveMetadata`, `MergeMetadata`|
|SavvyioOptions|⬇️|`AddDispatchers`, `AddHandlers`|
|Task|⬇️|`SingleOrDefaultAsync`|
1 change: 1 addition & 0 deletions .docfx/includes/availability-modern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Availability: .NET 9 and .NET 8
40 changes: 19 additions & 21 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AWSSDK.SQS" Version="3.7.400.47" />
<PackageVersion Include="AWSSDK.SimpleNotificationService" Version="3.7.400.47" />
<PackageVersion Include="AWSSDK.SQS" Version="3.7.400.49" />
<PackageVersion Include="AWSSDK.SimpleNotificationService" Version="3.7.400.49" />
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<PackageVersion Include="Azure.Messaging.EventGrid" Version="4.27.0" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.20.1" />
<PackageVersion Include="Codebelt.Extensions.Newtonsoft.Json" Version="9.0.0-rc.1" />
<PackageVersion Include="Codebelt.Extensions.Xunit.App" Version="9.0.0-rc.1" />
<PackageVersion Include="Codebelt.Extensions.YamlDotNet" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Extensions.Collections.Generic" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Extensions.Core" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Extensions.DependencyInjection" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Extensions.IO" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Extensions.Reflection" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Extensions.Text.Json" Version="9.0.0-rc.1" />
<PackageVersion Include="Cuemon.Security.Cryptography" Version="9.0.0-rc.1" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.21.0" />
<PackageVersion Include="Codebelt.Extensions.Newtonsoft.Json" Version="9.0.0" />
<PackageVersion Include="Codebelt.Extensions.Xunit.App" Version="9.0.0" />
<PackageVersion Include="Codebelt.Extensions.YamlDotNet" Version="9.0.0" />
<PackageVersion Include="Cuemon.Extensions.Collections.Generic" Version="9.0.0" />
<PackageVersion Include="Cuemon.Extensions.Core" Version="9.0.0" />
<PackageVersion Include="Cuemon.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Cuemon.Extensions.IO" Version="9.0.0" />
<PackageVersion Include="Cuemon.Extensions.Reflection" Version="9.0.0" />
<PackageVersion Include="Cuemon.Extensions.Text.Json" Version="9.0.0" />
<PackageVersion Include="Cuemon.Security.Cryptography" Version="9.0.0" />
<PackageVersion Include="Dapper.StrongName" Version="2.1.35" />
<PackageVersion Include="DapperExtensions.StrongNameReference" Version="1.9.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.10.0" />
Expand All @@ -33,18 +33,16 @@
<PackageVersion Include="xunit.runner.console" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Savvy I/O

An open-source project (MIT license) that provides a SOLID and clean .NET class library for writing DDD, CQRS and Event Sourcing applications for .NET 8 (LTS) and .NET 6 (LTS).
An open-source project (MIT license) that provides a SOLID and clean .NET class library for writing DDD, CQRS and Event Sourcing applications for .NET 9 (STS) and .NET 8 (LTS).

![Savvy I/O Flow](.assets/savvyio.png)

Expand Down
7 changes: 6 additions & 1 deletion src/Savvyio.Core/MetadataDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class MetadataDictionary : IMetadataDictionary
/// Gets a list of the reserved keywords.
/// </summary>
/// <value>A list of the reserved keywords.</value>
public static IReadOnlyCollection<string> ReservedKeywords { get; } = Arguments.ToEnumerableOf(Timestamp, MemberType, CorrelationId, CausationId, EventId, AggregateVersion).ToList();
public static IReadOnlyCollection<string> ReservedKeywords { get; } = Arguments.ToEnumerableOf(Timestamp, MemberType, CorrelationId, RequestId, CausationId, EventId, AggregateVersion).ToList();

internal static string EnsureReservedKeywordCapitalization(string key)
{
Expand All @@ -40,6 +40,11 @@ internal static string EnsureReservedKeywordCapitalization(string key)
/// </summary>
public const string CorrelationId = nameof(CorrelationId);

/// <summary>
/// RequestId is a reserved keyword.
/// </summary>
public const string RequestId = nameof(RequestId);

/// <summary>
/// CausationId is a reserved keyword.
/// </summary>
Expand Down
24 changes: 24 additions & 0 deletions src/Savvyio.Core/MetadataExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ public static string GetCorrelationId<T>(this T request) where T : IMetadata
return MetadataFactory.Get(request, MetadataDictionary.CorrelationId).As<string>();
}

/// <summary>
/// Gets the string representation of the request identifier from the <paramref name="request"/>.
/// </summary>
/// <typeparam name="T">The model that implements the <see cref="IMetadata"/> interface.</typeparam>
/// <param name="request">The <see cref="IMetadata"/> to extend.</param>
/// <returns>The string representation of the request identifier from the <paramref name="request"/>.</returns>
public static string GetRequestId<T>(this T request) where T : IMetadata
{
return MetadataFactory.Get(request, MetadataDictionary.RequestId).As<string>();
}

/// <summary>
/// Gets the string representation of the underlying member type of <paramref name="request"/>.
/// </summary>
Expand Down Expand Up @@ -70,6 +81,19 @@ public static T SetCorrelationId<T>(this T request, string correlationId) where
return request;
}

/// <summary>
/// Assigns a new <paramref name="requestId"/> to the <paramref name="request"/>.
/// </summary>
/// <typeparam name="T">The model that implements the <see cref="IMetadata"/> interface.</typeparam>
/// <param name="request">The <see cref="IMetadata"/> to extend.</param>
/// <param name="requestId">The request identifier of the model.</param>
/// <returns>A reference to <paramref name="request"/> after the operation has completed.</returns>
public static T SetRequestId<T>(this T request, string requestId) where T : IMetadata
{
MetadataFactory.Set(request, MetadataDictionary.RequestId, requestId);
return request;
}

/// <summary>
/// Assigns a new <paramref name="eventId"/> to the <paramref name="request"/>.
/// </summary>
Expand Down
Loading

0 comments on commit d943657

Please sign in to comment.