![]() |
VOOZH | about |
dotnet add package Net4x.DapperLibrary.Extensions.Archive --version 1.9.9.8
NuGet\Install-Package Net4x.DapperLibrary.Extensions.Archive -Version 1.9.9.8
<PackageReference Include="Net4x.DapperLibrary.Extensions.Archive" Version="1.9.9.8" />
<PackageVersion Include="Net4x.DapperLibrary.Extensions.Archive" Version="1.9.9.8" />Directory.Packages.props
<PackageReference Include="Net4x.DapperLibrary.Extensions.Archive" />Project file
paket add Net4x.DapperLibrary.Extensions.Archive --version 1.9.9.8
#r "nuget: Net4x.DapperLibrary.Extensions.Archive, 1.9.9.8"
#:package Net4x.DapperLibrary.Extensions.Archive@1.9.9.8
#addin nuget:?package=Net4x.DapperLibrary.Extensions.Archive&version=1.9.9.8Install as a Cake Addin
#tool nuget:?package=Net4x.DapperLibrary.Extensions.Archive&version=1.9.9.8Install as a Cake Tool
Utilities to create archive tables and move old data to archive tables when saving DataTable/DataSet instances via IDapperContext.
ArchiveSetting
PrefixToArchive and PrefixArchived � prefixes used to identify tables to archive and the archived target name.IsArchiveEnabled � toggle archiving behaviour.PrimaryKeysForTableType � strategy for determining primary keys for tables (IPrimaryKeysForTableType from DapperLibrary.Data).ITableArchiver
ArchiveOldTableAsync(...) � move or save existing rows to the archive and remove them from the original table.CreateArchiveTableIfNotExists(...) � ensure the archive table exists with the appropriate schema before archiving.TableArchiver (default implementation)
ITableArchiver and provides the default archiving logic:
IDapperContext.LoadDataTableFromNameAsync.columnsToAdd as part of the composite primary key) so archived rows can include e.g. modification timestamps.SaveDataTableExtension / SaveDataSetExtension
SaveDataTable/SaveDataSet and async overloads that integrate archiving into the save flow.ConnectionStringToRead but connection-specific methods are available.primaryKeySize � size to use when creating primary key columns on new tables.chunkSize � number of rows to delete at once when removing archived rows from the original table.columnsToAdd � extra columns that get added to the primary key of archived rows (for example ModifiedDate).emptyTable � whether to empty/replace the original table before saving.addDateSuffix � append a date suffix to the table name when saving (useful to avoid name collisions).rowPreProcessor � optional IRowPreProcessor called before save to modify rows (e.g. generate UUIDs).tableArchiver � custom ITableArchiver implementation (if null, default TableArchiver logic is used).CreateTableExtension / CreateOrEmptyOriginalAndSaveTableExtension
ArchiveSetting.IsArchiveEnabled flag; when disabled the archiver is a no-op.PrefixToArchive or PrefixArchived.IPrimaryKeysForTableType and appends any specified columnsToAdd to the composite primary key.var archiveSetting = new ArchiveSetting("ToArchive_", "Archived_", true, new MyPrimaryKeysForTableType());
// Save a single DataTable while archiving old rows:
var (affectedRows, sql) = await dapperContext.SaveDataTableAsync(
dataTable,
rowPreProcessor: null,
primaryKeySize: 50,
emptyTable: false,
archiveSetting: archiveSetting,
tableArchiver: null, // use default TableArchiver
chunkSize: 1000,
addDateSuffix: false
);
// Or save an entire DataSet and archive each table as needed:
var (totalAffected, sqlStatements) = await dapperContext.SaveDataSetAsync(
dataSet,
connectionStringName: "MyConnection",
rowPreProcessor: null,
primaryKeySize: 50,
archiveSetting: archiveSetting,
tableArchiver: null,
emptyTable: false,
chunkSize: 1000
);
DapperLibrary.DbContexts and DapperLibrary.Data abstractions.ITableArchiver for custom archiving strategies (e.g. copy to external storage, compress archived rows, or transmit them to a separate archival database).IPrimaryKeysForTableType implementation to control how primary keys are detected or assigned for different table types.See repository root for license and contribution guidelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net35 net35 is compatible. net40 net40 is compatible. net403 net403 was computed. net45 net45 is compatible. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.