Sharpify.Data 2.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Sharpify.Data --version 2.1.0                
NuGet\Install-Package Sharpify.Data -Version 2.1.0                
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="Sharpify.Data" Version="2.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharpify.Data --version 2.1.0                
#r "nuget: Sharpify.Data, 2.1.0"                
#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.
// Install Sharpify.Data as a Cake Addin
#addin nuget:?package=Sharpify.Data&version=2.1.0

// Install Sharpify.Data as a Cake Tool
#tool nuget:?package=Sharpify.Data&version=2.1.0                

CHANGELOG

v2.1.0

  • Small breaking change in DatabaseFilter{T}, the filter will now use a : delimiter between the type name and the key, this means you keys won't be found if were upserted using pre-change filters. This is unfortunate but necessary change in order to 1. enable better filtering of keys from the Database, enabling searching and using split to get the second portion of the key. and 2. to lay the groundwork of possibly implementing more filters in the future.

  • DatabaseFilter{T} type was changed from readonly struct to class, and it now implements the IDatabaseFilter{T} interface. the internal CreateKey that in the default implementation uses the type name and : to create a "filtered" key, is now marked as virtual. So that it is possible to inherit from DatabaseFilter{T} and override CreateKey to either use a different template, or even add to it, for example if you have nested generics, such as TMemoryPackable<TOther>, in which case the default DatabaseFilter{T} would not be able do distinguish between the inner generic, possibly causing issues with serialization and deserialization. The change to class also should be costly, as the database filter can be stored as a field as well, and used similarly to dbContext of other databases. In case overriding CreateKey is not enough, you can of course implement the whole IDatabaseFilter{T} interface if you so choose.

DatabaseFilter{T} was initially designed better in the context of APIs, no longer offering the Get, but instead using TryGetValue, while it might require 1 line of code more, when reading and writing the code, it is less ambiguous, before, a null or default result could indicate not found, failed to deserialized, and even upserted as null. Now if TryGetValue returns false there can only be one reason and that is that the key did not exist.

  • To improve this conciseness, Database now has TryGetValue offerings, for regular ReadOnlyMemory{byte} output, IMemoryPackable{T} and string. These are now the preferred APIs to use when retrieving values.

  • The old Get variants of Database are now marked as Deprecated to signal they shouldn't be used. This was made to reduce the amount of breaking changes in this version, the Get variants will stay on as Deprecated until the next Major version, at which point they will be deleted. I hope this gives you enough time to "migrate".

  • UpsertAsString and UpsertAsT(JSON version), are now also named just Upsert, their overload is inferred from the type of the arguments as string is not IMemoryPackable{T} and the JSON T version requires a JsonSerializerContext.

  • Also added TryGetValue overloads for JSON T, you will know them because they both require a JsonSerializerContext. apparently before this version you could only Upsert a JSON T, I apologize for the oversight.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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 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. 
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
2.6.0 83 11/13/2024
2.5.0 85 7/30/2024
2.4.1 86 6/3/2024
2.4.0 84 5/30/2024
2.3.0 127 4/17/2024
2.2.0 134 3/2/2024
2.1.3 116 1/25/2024
2.1.2 105 1/25/2024
2.1.1 109 1/25/2024
2.1.0 129 1/25/2024
2.0.2 105 1/23/2024
2.0.1 106 1/22/2024
2.0.0 101 1/20/2024
1.1.0 118 1/15/2024
1.0.3 127 1/8/2024
1.0.2 132 1/5/2024
1.0.1 126 1/4/2024
1.0.0 122 1/4/2024