Dapper.DDD.Repository.DependencyInjection
1.1.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Dapper.DDD.Repository.DependencyInjection --version 1.1.2
NuGet\Install-Package Dapper.DDD.Repository.DependencyInjection -Version 1.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dapper.DDD.Repository.DependencyInjection" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dapper.DDD.Repository.DependencyInjection" Version="1.1.2" />
<PackageReference Include="Dapper.DDD.Repository.DependencyInjection" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dapper.DDD.Repository.DependencyInjection --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Dapper.DDD.Repository.DependencyInjection, 1.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dapper.DDD.Repository.DependencyInjection@1.1.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dapper.DDD.Repository.DependencyInjection&version=1.1.2
#tool nuget:?package=Dapper.DDD.Repository.DependencyInjection&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dapper.DDD.Repository.DependencyInjection
This package provides support for using Dapper.DDD.Repository with the built-in Dependency Injection in .NET.
Usage
After adding this package, you can use the methods
- ConfigureDapperRepositoryDefaults
- AddTableRepository (Multiple overloads available)
- AddViewRepository (Multiple overloads available)
On an IServiceCollection to inject all the repositories you're going to use.
Typically this will be available in Program.cs, though I suggest moving the actual Dapper configuration to your infrastructure layer, similar to this:
public static IServiceCollection AddInfrastructure(this IServiceCollection services, string connectionString)
{
return services.ConfigureDapperRepositoryDefaults(config =>
{
config.QueryGeneratorFactory = new SqlQueryGeneratorFactory();
config.ConnectionFactory = new SqlConnectionFactory(connectionString);
config.DapperInjectionFactory = new DapperInjectionFactory();
config.Schema = "dbo";
})
.AddTableRepository<WeatherForecast, long>(config =>
{
config.HasKey(weatherForecast => weatherForecast.Id);
config.HasIdentity(weatherForecast => weatherForecast.Id);
config.TableName = "WeatherForecasts";
config.HasDefault(weatherForecast => weatherForecast.Timestamp);
})
.AddTableRepository<WeatherStation, int, IWeatherStationRepository, WeatherStationRepository>(config =>
{
config.HasKey(weatherStation => weatherStation.Id);
config.HasIdentity(weatherStation => weatherStation.Id);
config.TableName = "WeatherStations";
})
.AddViewRepository<WeatherForecastView, IWeatherForecastViewRepository, WeatherForecastViewRepository>(config =>
{
config.ViewName = "WeatherForecastView";
});
}
And then simply calling builder.Services.AddInfrastructure from Program.cs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Dapper.DDD.Repository (>= 1.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.3 | 1,863 | 7/24/2025 |
| 1.10.2 | 559 | 7/23/2025 |
| 1.10.1 | 602 | 7/22/2025 |
| 1.10.0 | 4,471 | 1/28/2025 |
| 1.9.1 | 3,576 | 11/28/2024 |
| 1.9.0 | 1,070 | 11/20/2024 |
| 1.8.1 | 2,903 | 5/13/2024 |
| 1.8.0 | 259 | 1/16/2024 |
| 1.3.0 | 371 | 3/10/2023 |
| 1.2.0 | 3,123 | 11/25/2022 |
| 1.1.3 | 1,532 | 7/23/2022 |
| 1.1.2 | 559 | 7/13/2022 |
| 1.1.1 | 674 | 7/10/2022 |
| 1.1.0 | 561 | 7/10/2022 |
| 1.0.1 | 576 | 7/9/2022 |
| 1.0.0 | 567 | 7/9/2022 |