An open API service indexing awesome lists of open source software.

https://github.com/junioranheu/nuget-package-bulk.sql

An easy-to-use and light NuGet package that simplifies the process of performing bulk inserts in .NET 6 applications. With Bulk.Sql you can efficiently insert and delete large amounts of data into your database tables, improving performance and reducing execution time.
https://github.com/junioranheu/nuget-package-bulk.sql

bulk-copy bulk-inserts csharp mysql net6 nuget-package performance sql sql-server

Last synced: 4 months ago
JSON representation

An easy-to-use and light NuGet package that simplifies the process of performing bulk inserts in .NET 6 applications. With Bulk.Sql you can efficiently insert and delete large amounts of data into your database tables, improving performance and reducing execution time.

Awesome Lists containing this project

README

        

## @junioranheu/Bulk.Sql

An easy-to-use and light NuGet package that simplifies the process of performing bulk inserts/deletes in .NET 6 applications. With Bulk.Sql you can efficiently insert and delete large amounts of data into your database tables, improving performance and reducing execution time.

👉 Take a look at the usage section below to see how you can use the NuGet package correctly.

## Deployment

[NuGet Gallery](https://www.nuget.org/packages/Bulk.Sql/).

## Getting Started
### Installation

You can install Bulk.Sql via NuGet Package Manager or by using the .NET CLI.

NuGet Package Manager:

```
Install-Package Bulk.Sql
```

.NET CLI:

```
dotnet add package Bulk.Sql
```

### BulkInsert usage

Once you have installed the Bulk.Sql package, you can follow these steps to start using it in your .NET 6 project:

```
await Bulk.Helpers.BulkInsert(list, _context, "TableName");
```

or

```
await Bulk.Helpers.BulkInsert(list, con, "TableName");
```

The first parameter requires a list — commonly resulting from a LINQ query.

The second parameter allows you to pass whether the application's context, a SqlConnection (Microsoft.Data.SqlClient or System.Data.SqlClient), or a MySqlConnection data base connection.

E.g.: new SqlConnection(connectionString) or new MySqlConnection(connectionString).

The third parameter requires the aiming table's name.

There are other optional parameters. Be sure to check them out after downloading the package.

### BulkDelete usage

```
await Bulk.Helpers.BulkDelete(_context, condition: x => x.Status == true && x.Amount >= 22);
```

or

```
await Bulk.Helpers.BulkDelete(_context);
```

The first parameter requires the application's context.

The second parameter is optional. You can pass a LINQ expression.

## Compatibility

Bulk.Sql is compatible with .NET 6. It supports the following database providers: SQL Server (Microsoft.Data.SqlClient or System.Data.SqlClient) and MySQL.

## Support

If you need any assistance or have any questions, feel free to reach out to me at [email protected].