⚠ Deprecated: Other, Legacy
Aiming for a web app project template to supersede this whole idea. The plan is for SlappFramework.Com to eventually have more info.
BulkOpsHelper streamlines the creation of data validations for bulk insert and bulk update operations in SQL Server databases. 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.
$ dotnet add package BulkOpsHelperBulkOpsHelper 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.
// 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.