![]() |
VOOZH | about |
dotnet add package Dapper.Bulk --version 1.6.0
NuGet\Install-Package Dapper.Bulk -Version 1.6.0
<PackageReference Include="Dapper.Bulk" Version="1.6.0" />
<PackageVersion Include="Dapper.Bulk" Version="1.6.0" />Directory.Packages.props
<PackageReference Include="Dapper.Bulk" />Project file
paket add Dapper.Bulk --version 1.6.0
#r "nuget: Dapper.Bulk, 1.6.0"
#:package Dapper.Bulk@1.6.0
#addin nuget:?package=Dapper.Bulk&version=1.6.0Install as a Cake Addin
#tool nuget:?package=Dapper.Bulk&version=1.6.0Install as a Cake Tool
FeaturesDapper.Bulk contains helper methods for bulk inserting.
Download<a href="https://www.nuget.org/packages/Dapper.Bulk/" target="_blank">Dapper.Bulk Nuget</a>
PM> Install-Package Dapper.Bulk
Usageconnection.BulkInsert(data);
await connection.BulkInsertAsync(data);
var inserted = connection.BulkInsertAndSelect(data);
var inserted = await connection.BulkInsertAndSelectAsync(data);
Default ConventionsTableName is TypeName + s. When Interface I is removed.Key is Id property (case-insensitive)Custom ConventionsTableName - somewhere before usage call.
TableMapper.SetupConvention("tbl", "s")
AttributesWe do not rely on specific attributes. This means you can use whatever attributes with following names:
TableAttribute - Must have string Name property. Exists in System.ComponentModel.Annotations Nuget.ColumnAttribute - Must have string Name property. Exists in System.ComponentModel.Annotations Nuget.KeyAttribute - Marking only attribute. Exists in System.ComponentModel.Annotations Nuget.ComputedAttribute - Marking only attribute. For fields returned from Db.NotMapped - Marking only attribute. For ignored fields.// Table Cars by default convention
public class Car
{
// Identity by convention
public int Id { get; set; }
public string Name { get; set; }
public DateTime ManufactureDate { get; set; }
}
// Supported in v1.2+
public enum CarType : int
{
Classic = 1,
Coupe = 2
}
[Table("tblCars")]
public class Car
{
[Key] // Identity
public int CarId { get; set; }
public string Name { get; set; }
public CarType CarType { get; set; } //SQL Data Type should match Enum type
[Computed] // Will be ignored for inserts, but the value in database after insert will be returned
public DateTime ManufactureDate { get; set; }
}
public class IdentityAndNotMappedTest
{
[Key]
public int IdKey { get; set; }
public string Name { get; set; }
// Will be ignored for inserts
public virtual TestSublass TestSublass { get; set; }
[NotMapped] // Will be ignored for inserts
public int Ignored { get; set; }
}
// Supported in v1.4+
private class CustomColumnName
{
[Key]
public int IdKey { get; set; }
[Column("Name_1")] // Will map to SQL column Name_1
public string Name { get; set; }
[Column("Int_Col")] // Will map to SQL column Int_Col
public int IntCol { get; set; }
[Column("Long_Col")] // Will map to SQL column Long_Col
public long LongCol { get; set; }
[NotMapped] // Will be ignored for inserts
public int Ignored { get; set; }
[Write(false)] // Will be ignored for inserts
public int Ignored { get; set; }
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Dapper.Bulk:
| Package | Downloads |
|---|---|
|
Z.Core.Infrastructure
Z.Core.Infrastructure |
|
|
SH.Infrastructure
Chứa các hàm common Dapper,EF Core 8 |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.0 | 475,871 | 2/8/2023 |
| 1.5.0 | 244,077 | 5/17/2021 |
| 1.4.2 | 165,526 | 3/4/2019 |
| 1.4.1 | 10,140 | 1/18/2019 |
| 1.4.0 | 2,138 | 12/25/2018 |
| 1.3.0 | 9,492 | 9/25/2018 |
| 1.2.0 | 5,829 | 7/14/2018 |
| 1.1.1 | 19,002 | 6/4/2018 |
| 1.1.0 | 10,972 | 4/14/2018 |
| 1.0.3 | 2,580 | 11/11/2017 |
| 1.0.2 | 1,613 | 10/30/2017 |
| 1.0.1 | 1,607 | 10/29/2017 |
| 1.0.0 | 2,279 | 10/29/2017 |
-Reference package Microsoft.Data.SqlClient instead of System.Data.SqlClient
-Added support for Schema attribute
-Allow ColumnName and Key on the same field
-TargetFramework is now net6.0
-Updated nugets and code style