MVFC.Pack.IoC
4.0.0
dotnet add package MVFC.Pack.IoC --version 4.0.0
NuGet\Install-Package MVFC.Pack.IoC -Version 4.0.0
<PackageReference Include="MVFC.Pack.IoC" Version="4.0.0" />
<PackageVersion Include="MVFC.Pack.IoC" Version="4.0.0" />
<PackageReference Include="MVFC.Pack.IoC" />
paket add MVFC.Pack.IoC --version 4.0.0
#r "nuget: MVFC.Pack.IoC, 4.0.0"
#:package MVFC.Pack.IoC@4.0.0
#addin nuget:?package=MVFC.Pack.IoC&version=4.0.0
#tool nuget:?package=MVFC.Pack.IoC&version=4.0.0
MVFC.Pack.IoC
Metapackage for Dependency Injection setup — source-generated mediator registration, automatic service scanning, FluentValidation DI integration and resilient HTTP clients.
Motivation
Configuring the IoC container in a modern- .NET 9+ microservice involves the same repetitive steps: registering MediatR handlers, wiring FluentValidation into DI, scanning and registering services automatically, and building resilient HTTP clients with Polly.
MVFC.Pack.IoC centralizes all of this. The source generators activate at compile time — meaning zero reflection overhead at runtime — and the resilience pipeline follows the .NET standard patterns out of the box.
Installation
dotnet add package MVFC.Pack.IoC
Quick Start
// 1. MediatR registration
builder.Services.AddMediatR(cfg =>
cfg.RegisterServicesFromAssemblyContaining<Program>());
// 2. Automatic service scanning via ServiceScan source generator
// Decorate your partial class and all matching services are registered at compile time
[RegisterServices]
public partial class ServiceRegistrar;
// 3. FluentValidation DI integration
builder.Services.AddValidatorsFromAssemblyContaining<Program>();
// 4. Resilient HTTP client with HttpClientFactory + Polly
builder.Services.AddHttpClient<IPaymentApi>(client =>
client.BaseAddress = new Uri(builder.Configuration["PaymentApi:BaseUrl"]!))
.AddStandardResilienceHandler();
Included Packages
| Package | Version |
|---|---|
| MediatR | 12.5.0 |
| ServiceScan.SourceGenerator | 2.4.1 |
| FluentValidation.DependencyInjectionExtensions | 12.1.1 |
| Microsoft.Extensions.Http | 10.0.3 |
| Microsoft.Extensions.Http.Resilience | 10.3.0 |
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 is compatible. 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. |
-
net10.0
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- MediatR (= 12.5.0)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Http.Resilience (>= 10.4.0)
- ServiceScan.SourceGenerator (>= 3.0.3)
-
net9.0
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- MediatR (= 12.5.0)
- Microsoft.Extensions.Http (>= 9.0.2)
- Microsoft.Extensions.Http.Resilience (>= 9.2.0)
- ServiceScan.SourceGenerator (>= 3.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.