Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 4 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.8" />
Expand All @@ -23,8 +24,8 @@
<PackageVersion Include="System.Collections.Immutable" Version="10.0.8" />
<PackageVersion Include="System.Linq.Async" Version="7.0.1" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
<PackageVersion Include="TinyBDD" Version="0.19.14" />
<PackageVersion Include="TinyBDD.Xunit" Version="0.19.14" />
<PackageVersion Include="TinyBDD" Version="0.19.21" />
<PackageVersion Include="TinyBDD.Xunit" Version="0.19.21" />
<PackageVersion Include="Testcontainers" Version="4.12.0" />
<PackageVersion Include="Testcontainers.RabbitMq" Version="4.12.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
Expand Down
2 changes: 2 additions & 0 deletions PatternKit.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Project Path="src/PatternKit.Examples/PatternKit.Examples.csproj" />
<Project Path="src/PatternKit.Generators/PatternKit.Generators.csproj" />
<Project Path="src/PatternKit.Generators.Abstractions/PatternKit.Generators.Abstractions.csproj" />
<Project Path="src/PatternKit.Hosting.Extensions/PatternKit.Hosting.Extensions.csproj" />
</Folder>
<Folder Name="/benchmarks/">
<Project Path="benchmarks\PatternKit.Benchmarks\PatternKit.Benchmarks.csproj" Type="Classic C#" />
Expand All @@ -18,5 +19,6 @@
<Project Path="test/PatternKit.Tests/PatternKit.Tests.csproj" />
<Project Path="test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj" Type="Classic C#" />
<Project Path="test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj" Type="Classic C#" />
<Project Path="test\PatternKit.Hosting.Extensions.Tests\PatternKit.Hosting.Extensions.Tests.csproj" Type="Classic C#" />
</Folder>
</Solution>
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,33 @@ Install via NuGet:
dotnet add package PatternKit --version <latest>
```

For first-party `IServiceCollection` integration in ASP.NET Core, worker services, or generic host apps:

```bash
dotnet add package PatternKit.Hosting.Extensions --version <latest>
```

```csharp
using Microsoft.Extensions.DependencyInjection;
using PatternKit.Hosting.DependencyInjection;
using PatternKit.Messaging.Channels;

var services = new ServiceCollection();

services
.AddPatternKitMessageChannel<OrderCommand>(
"orders",
channel => channel.WithCapacity(100, MessageChannelBackpressurePolicy.Reject))
.AddPatternKitRetryPolicy<ServiceReply>(
"inventory-retry",
retry => retry.WithMaxAttempts(3).HandleResult(static reply => !reply.Available));

public sealed record OrderCommand(string OrderId, decimal Total);
public sealed record ServiceReply(bool Available);
```

See [Hosting Extensions](docs/guides/hosting-extensions.md) for reusable DI registrations that do not depend on the examples assembly.

Use a pattern immediately—here’s a simple **Strategy**:

```csharp
Expand Down
Loading
Loading