Net4x.PropertyBagLibrary 1.9.9.26247

dotnet add package Net4x.PropertyBagLibrary --version 1.9.9.26247
                    
NuGet\Install-Package Net4x.PropertyBagLibrary -Version 1.9.9.26247
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Net4x.PropertyBagLibrary" Version="1.9.9.26247" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.PropertyBagLibrary" Version="1.9.9.26247" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.PropertyBagLibrary" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Net4x.PropertyBagLibrary --version 1.9.9.26247
                    
#r "nuget: Net4x.PropertyBagLibrary, 1.9.9.26247"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Net4x.PropertyBagLibrary@1.9.9.26247
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Net4x.PropertyBagLibrary&version=1.9.9.26247
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.PropertyBagLibrary&version=1.9.9.26247
                    
Install as a Cake Tool

PropertyBagLibrary

Helpers to convert optional DataTable columns into JSON property bags and utilities to temporarily patch/restore primary keys when saving datasets via IDapperContext.

Purpose

  • Convert non-mandatory columns of a DataTable into a single JSON column (property bag) to simplify storage or transfer while keeping required columns as explicit fields.
  • Provide utilities to merge/enrich property bags with values from loaded rows and to patch primary keys (generated vs historical IDs) when persisting data via database contexts.

Main functionality

  • DataTableJsonExtension.ConvertNonMandatoryColumnsToPropertyBag(this DataTable dataTable, string[] mandatoryFields, string propertyBagColumnName, params ColumnDefinition[] additionalColumnsToAdd)

    • Moves every column not listed in mandatoryFields into a JSON string stored in propertyBagColumnName for each row.
    • Adds implicit mandatory columns if requested and can preserve or merge existing property-bag JSON values.
  • PropertyBagHelper extensions

    • Methods to enrich consolidated rows with values from loaded rows, manage property-bag dictionaries, and save patched dictionaries back into the property bag column.
    • Uses Newtonsoft.Json for serialization and CoreLibrary.Utility.Conversion helpers for conversions.
  • PrimaryKeyPatchRestore extensions (requires IDapperContext)

    • PutGeneratedPrimaryKeyAsync / PutHistoricalPrimaryKeyAsync helpers that iterate DataTable or DataSet rows and call a ProcessColumnDelegate to map or patch primary key values after insert operations.
    • Useful when data save operations return generated IDs that need to be propagated back into in-memory tables or when historical IDs must be substituted.

Typical usage

  • Convert optional columns into a property bag before saving or serializing:
var mandatory = new[] { "Id", "Name" };
var ok = dataTable.ConvertNonMandatoryColumnsToPropertyBag(mandatory, "PropertyBag");
  • Merge values from a loaded entity into a consolidated row and update its property bag:
var modified = consolidatedRow.EnrichConsolidatedTableColumnWithValuesFromLoadedTable(
    dateTime, column, loadedRow, "PropertyBag", "ModifiedDate");
  • Patch primary keys after saving with IDapperContext:
// processColumn is a delegate that applies the returned generated id into the DataRow
await dapperContext.PutGeneratedPrimaryKeyAsync(dataTable, valueTuples, "GeneratedId", "HistoricalId", processColumn);

Notes and recommendations

  • Serialization uses Newtonsoft.Json so ensure the package is available for your target framework.
  • The property bag column is stored as a JSON string; consumers must deserialize it to access contained key/value pairs.
  • The library operates in-memory on DataTable/DataSet objects; it is not optimized for extremely large datasets. For large volumes prefer streaming or database-side approaches.
  • Primary key patching helpers are asynchronous to accommodate database roundtrips; provide a ProcessColumnDelegate implementation that performs any required ID mapping.

Dependencies

  • Newtonsoft.Json for JSON serialization.
  • DapperLibrary.Data and DapperLibrary.DbContexts for integration helpers.
  • CoreLibrary utilities for conversions and logging.

License / Contributing

See repository root for license and contribution guidelines.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.9.9.26247 94 9/4/2026
1.9.9.9 112 7/27/2026
1.9.9.8 161 2/2/2026
1.9.9.7 151 1/13/2026
1.9.9.6 143 1/6/2026
1.9.9.5 143 1/6/2026
1.9.9.4 145 1/6/2026
1.9.9.3 152 1/5/2026
1.9.9.2 146 12/30/2025
1.9.9.1 145 12/30/2025
1.9.9 232 12/22/2025
1.6.0.12 180 12/12/2025
1.6.0.11 187 12/12/2025
1.6.0.10 492 12/9/2025
1.6.0.9 256 12/4/2025
1.6.0.8 258 12/4/2025
1.6.0.7 317 11/30/2025
1.6.0.6 240 11/27/2025
1.6.0.5 290 11/22/2025
1.6.0.4 204 11/16/2025
Loading failed