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
<PackageReference Include="Net4x.PropertyBagLibrary" Version="1.9.9.26247" />
<PackageVersion Include="Net4x.PropertyBagLibrary" Version="1.9.9.26247" />
<PackageReference Include="Net4x.PropertyBagLibrary" />
paket add Net4x.PropertyBagLibrary --version 1.9.9.26247
#r "nuget: Net4x.PropertyBagLibrary, 1.9.9.26247"
#:package Net4x.PropertyBagLibrary@1.9.9.26247
#addin nuget:?package=Net4x.PropertyBagLibrary&version=1.9.9.26247
#tool nuget:?package=Net4x.PropertyBagLibrary&version=1.9.9.26247
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
DataTableinto 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
mandatoryFieldsinto a JSON string stored inpropertyBagColumnNamefor each row. - Adds implicit mandatory columns if requested and can preserve or merge existing property-bag JSON values.
- Moves every column not listed in
PropertyBagHelperextensions- 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.Jsonfor serialization andCoreLibrary.Utility.Conversionhelpers for conversions.
PrimaryKeyPatchRestoreextensions (requiresIDapperContext)PutGeneratedPrimaryKeyAsync/PutHistoricalPrimaryKeyAsynchelpers that iterateDataTableorDataSetrows and call aProcessColumnDelegateto 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.Jsonso 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/DataSetobjects; 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
ProcessColumnDelegateimplementation that performs any required ID mapping.
Dependencies
Newtonsoft.Jsonfor JSON serialization.DapperLibrary.DataandDapperLibrary.DbContextsfor integration helpers.CoreLibraryutilities for conversions and logging.
License / Contributing
See repository root for license and contribution guidelines.
| Product | Versions 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. |
-
.NETFramework 3.5
- Net4x.AsyncBridge (>= 1.5.0.26243)
- Net4x.BaseTypes (>= 1.3.1.26243)
- Net4x.DapperLibrary.Base (>= 1.9.9.26247)
- Newtonsoft.Json (>= 13.0.4)
-
.NETFramework 4.0
- Net4x.AsyncBridge (>= 1.5.0.26243)
- Net4x.BaseTypes (>= 1.3.1.26243)
- Net4x.DapperLibrary.Base (>= 1.9.9.26247)
- Newtonsoft.Json (>= 13.0.4)
-
.NETFramework 4.5
- Net4x.BaseTypes (>= 1.3.1.26243)
- Net4x.DapperLibrary.Base (>= 1.9.9.26247)
- Newtonsoft.Json (>= 13.0.4)
-
.NETFramework 4.6.1
- Net4x.BaseTypes (>= 1.3.1.26243)
- Net4x.DapperLibrary.Base (>= 1.9.9.26247)
- Newtonsoft.Json (>= 13.0.4)
-
.NETStandard 2.0
- Net4x.BaseTypes (>= 1.3.1.26243)
- Net4x.DapperLibrary.Base (>= 1.9.9.26247)
- Newtonsoft.Json (>= 13.0.4)
-
.NETStandard 2.1
- Net4x.BaseTypes (>= 1.3.1.26243)
- Net4x.DapperLibrary.Base (>= 1.9.9.26247)
- Newtonsoft.Json (>= 13.0.4)
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 |