Sharpify.Data
2.1.3
See the version list below for details.
dotnet add package Sharpify.Data --version 2.1.3
NuGet\Install-Package Sharpify.Data -Version 2.1.3
<PackageReference Include="Sharpify.Data" Version="2.1.3" />
paket add Sharpify.Data --version 2.1.3
#r "nuget: Sharpify.Data, 2.1.3"
// Install Sharpify.Data as a Cake Addin #addin nuget:?package=Sharpify.Data&version=2.1.3 // Install Sharpify.Data as a Cake Tool #tool nuget:?package=Sharpify.Data&version=2.1.3
CHANGELOG
v2.1.0
DatabaseFilter{T}
type was changed fromreadonly struct
toclass
, and it now implements theIDatabaseFilter{T}
interface. the internalCreateKey
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 fromDatabaseFilter{T}
and overrideCreateKey
to either use a different template, or even add to it, for example if you have nested generics, such asTMemoryPackable<TOther>
, in which case the defaultDatabaseFilter{T}
would not be able do distinguish between the inner generic, possibly causing issues with serialization and deserialization. The change toclass
also should be costly, as the database filter can be stored as a field as well, and used similarly todbContext
of other databases. In case overridingCreateKey
is not enough, you can of course implement the wholeIDatabaseFilter{T}
interface if you so choose.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 theDatabase
, 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.A temporary FIX to the breaking change in from the addition of the delimiter to
DatabaseFilter{T}
could be implemented rather easily using the new change from above, simply inherit fromDatabaseFilter{T}
, don't add anything, just override theCreateKey
function to returnstring.Concat(TName, key)
, this will behave exactly the same as the previous version ofDatabaseFilter{T}
. Nevertheless, I recommend this only as a temporary fix if you want to install the update but use existing data. at some point you should use the new feature.
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 hasTryGetValue
offerings, for regularReadOnlyMemory{byte}
output,IMemoryPackable{T}
andstring
. These are now the preferred APIs to use when retrieving values.The old
Get
variants ofDatabase
are now marked asDeprecated
to signal they shouldn't be used. This was made to reduce the amount of breaking changes in this version, theGet
variants will stay on asDeprecated
until the nextMajor
version, at which point they will be deleted. I hope this gives you enough time to "migrate".UpsertAsString
andUpsertAsT
(JSON version), are now also named justUpsert
, their overload is inferred from the type of the arguments as string is notIMemoryPackable{T}
and the JSONT
version requires aJsonSerializerContext
.Also added
TryGetValue
overloads for JSONT
, you will know them because they both require aJsonSerializerContext
. apparently before this version you could onlyUpsert
a JSONT
, I apologize for the oversight.
Product | Versions 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. |
-
net7.0
- MemoryPack (>= 1.10.0)
- Sharpify (>= 1.7.1)
-
net8.0
- MemoryPack (>= 1.10.0)
- Sharpify (>= 1.7.1)
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 |