ObjectBulkCopy 0.1.1
dotnet add package ObjectBulkCopy --version 0.1.1
NuGet\Install-Package ObjectBulkCopy -Version 0.1.1
<PackageReference Include="ObjectBulkCopy" Version="0.1.1" />
<PackageVersion Include="ObjectBulkCopy" Version="0.1.1" />
<PackageReference Include="ObjectBulkCopy" />
paket add ObjectBulkCopy --version 0.1.1
#r "nuget: ObjectBulkCopy, 0.1.1"
#addin nuget:?package=ObjectBulkCopy&version=0.1.1
#tool nuget:?package=ObjectBulkCopy&version=0.1.1
ObjectBulkCopy
A super simple C# library for performing SqlBulkCopy
directly on your CLR objects. No need to manually map properties--just plug in your list of objects and copy them to SQL Server with minimal setup. Ideal for high-performance data inserts in .NET applications.
Support Platform
- .NET 8.0+
[!Note] It is planned to be extended to .NET Standard in the future.
How to use
using System.ComponentModel.DataAnnotations.Schema;
[Table("Users")] // must set table name
public class User
{
[Column("Id", Order = 0)] // must set zero-based order
public required int Id { get; init; }
[Column("Name", Order = 1)]
public required string Name { get; init; }
}
using ObjectBulkCopy;
using (var connection = new SqlConnection(...))
{
User[] records
= [
new(){ Id = 0, Name = "xin9le" },
new(){ Id = 1, Name = "Takaaki Suzuki" },
];
const SqlBulkCopyOptions options = SqlBulkCopyOptions.Default;
const int? timeout = null;
var affectedCount = await connection.BulkInsertAsync(records, options, timeout, cancellationToken);
}
Installation
Getting started from downloading NuGet package.
dotnet add package ObjectBulkCopy
License
This library is provided under MIT License.
Author
Takaaki Suzuki (a.k.a @xin9le) is software developer in Japan who awarded Microsoft MVP for Developer Technologies (C#) since July 2012.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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 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. |
-
net8.0
- Microsoft.Data.SqlClient (>= 6.0.1)
-
net9.0
- Microsoft.Data.SqlClient (>= 6.0.1)
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 |
---|---|---|
0.1.1 | 142 | 11 days ago |