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.
- Host: GitHub
- URL: https://github.com/junioranheu/nuget-package-bulk.sql
- Owner: junioranheu
- Created: 2023-06-22T02:44:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T20:17:22.000Z (about 1 year ago)
- Last Synced: 2025-02-14T16:51:23.473Z (5 months ago)
- Topics: bulk-copy, bulk-inserts, csharp, mysql, net6, nuget-package, performance, sql, sql-server
- Language: C#
- Homepage: https://www.nuget.org/packages/Bulk.Sql/
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
### InstallationYou 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].