BulkOpsHelper 1.0.0
dotnet add package BulkOpsHelper --version 1.0.0
NuGet\Install-Package BulkOpsHelper -Version 1.0.0
<PackageReference Include="BulkOpsHelper" Version="1.0.0" />
paket add BulkOpsHelper --version 1.0.0
#r "nuget: BulkOpsHelper, 1.0.0"
// Install BulkOpsHelper as a Cake Addin #addin nuget:?package=BulkOpsHelper&version=1.0.0 // Install BulkOpsHelper as a Cake Tool #tool nuget:?package=BulkOpsHelper&version=1.0.0
BulkOpsHelper streamlines the creation of data validations for bulk insert and bulk update operations in SQL Server databases.
Quickstart:
Run "CreateBulkOpsInfrastructure.sql" (only once) against your existing Sql Server database.
Run the following stored procedure(s) as needed:
To scaffold a bulk INSERT feature:
EXEC [ZZ_BulkOpsHelper].[ScaffoldAn_INSERT_Feature] @DomainSchemaName = 'dbo_or_your_schema_name_here', @DomainTableName = 'TableNameHere', @StagingSchemaName = 'ZZ_BulkOpsHelper'
To scaffold a bulk UPDATE feature:
EXEC [ZZ_BulkOpsHelper].[ScaffoldAn_UPDATE_Feature] @DomainSchemaName = 'dbo_or_your_schema_name_here', @DomainTableName = 'TableNameHere', @StagingSchemaName = 'ZZ_BulkOpsHelper'
Notice row(s) added to the ZZ_BulkOpsHelper.BulkOpFeatures table.
- In your .NET project, install and reference the BulkOpsHelper.
- .NET CLI: "dotnet add package BulkOpsHelper"
- OR via package manager: "NuGet\Install-Package BulkOpsHelper"
- Call the BulkOpsHelper in your C# code: using SlappFramework; ... // Initialize settings... var bulkOpsSettings = new BulkOpsSettings(); bulkOpsSettings.ConnectionString = "connectionStringFromSomeConfigFile"; //...override defaults for other settings, if necessary
// Initialize a BulkOpsHelper... var bulkOpsHelper = new BulkOpsHelper(bulkOpsSettings);
// Call feature to process the given CSV data... // (Be sure CSV column headers match db column names.) DataSet results = bulkOpsHelper.ExecuteFeatureGivenFilePath( featureId: 1, csvFilePath: "C:\Path\To\CsvFile.csv"); // Returns a DataSet holding exactly 2 DataTables - // the first is a result summary, the second holds // validation errors (if any) similiar to the following: ResultTable001... IsSuccessful | RowsInserted | RowsUpdated | RowsDeleted true 1 0 0
ResultTable002 (empty if no validation errors) "Row 9, SomeColumnName: datatype invalid." "Row 10, AnotherColumName: FK violation."
Please see Slapp Framework for more details.
More About the BulkOpsHelper: Imagine you need to implement custom CSV uploads in your .NET application. The target table has foreign keys, unique keys, and custom constraints. How can you thoroughly validate a given CSV file, including providing detailed field-level feedback to the end-user, without building all the validation logic? The answer is the BulkOpsHelper!
BulkOpsHelper analyzes your destination table to provide comprehensive validations, ensuring that the data aligns with the table's definition. The core philosophy is simple: if the rules for the data are already defined in the table, why duplicate them elsewhere? BulkOpsHelper functions like an ORM but with added support for bulk operations, making it ideal for both bulk and single-record processing.
Please see Slapp Framework for more details.
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. |
-
net8.0
- CsvHelper (>= 33.0.1)
- Dapper (>= 2.1.35)
- Microsoft.Data.SqlClient (>= 5.2.1)
- NUnit (>= 4.1.0)
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 |
---|---|---|
1.0.0 | 89 | 11/8/2024 |
1.0.0-beta2 | 66 | 8/2/2024 |
1.0.0-beta1 | 74 | 7/30/2024 |
First non-beta release.