Skip to content

TrueAnalyticsSolutions/TAMS.EfBulk

Repository files navigation

TAMS EF Bulk

NuGet NuGet GitHub

TAMS EF Bulk provides methods for optimized bulk operations in Entity Framework using DataTables. This library aims to improve the performance of bulk insert and merge operations by leveraging DataTables and SqlBulkCopy.

Features

  • Bulk Insert
  • Bulk Merge
  • Support for multiple .NET frameworks:
    • .NET Core 3.1
    • .NET 4.5
    • .NET 8.0

Getting Started

Installation

You can install the package via NuGet Package Manager:

dotnet add package TAMS.EfBulk

Or via the Package Manager Console in Visual Studio:

Install-Package TAMS.EfBulk

Usage

Here's a basic example of how to use the library for bulk insert and merge operations:

using TAMS.EfBulk;
using Microsoft.EntityFrameworkCore;
using System.Data;

public class MyDbContext : DbContext
{
    // Your DbSet properties
}

public class MyEntity
{
    // Your entity properties
}

public class Example
{
    public async Task BulkOperationsAsync()
    {
        using var context = new MyDbContext();

        // Bulk Insert
        DataTable dataTable = await context.CreateDataTableAsync<MyEntity>();
        // Fill dataTable with data
        await context.BulkInsertAsync<MyEntity>(dataTable);

        // Bulk Merge
        await context.BulkMergeAsync<MyEntity>(dataTable, allowInsert: true, allowDelete: false);
    }
}

Documentation

For detailed documentation, refer to the official documentation.

Contributing

Contributions are welcome! Please read our contributing guidelines for more information.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

Authors

Acknowledgments

  • Special thanks to the developers and contributors who have helped in creating and maintaining this project.

Release Notes

0.1

  • Initial release.

Links

Feel free to reach out if you have any questions or need further assistance!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages