Skip to main content
net10.0net8.0net9.0

A super easy way to bulk copy your CLR objects to SQL Server — no fuss, no boilerplate.

Published
Oct 18, 2026
1mo ago
Total Downloads
8.5K
8,492

Install

dotnet add package ObjectBulkCopy --version 0.2.2
ProductVersions
.NET
net10.0net8.0net9.0

README

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.

Releases Nuget packages GitHub license

Support Platform

  • .NET 8.0+

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;
    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.

Changes from Previous Version

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.