Sharpify.Data 2.4.1

dotnet add package Sharpify.Data --version 2.4.1
NuGet\Install-Package Sharpify.Data -Version 2.4.1
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.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharpify.Data --version 2.4.1
#r "nuget: Sharpify.Data, 2.4.1"
#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.4.1

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

CHANGELOG

v2.4.1

  • Updated to version 2.0.0 of Sharpify.

If you use an older version of Sharpify this update is not a requirement, it mainly addresses a fix since DecryptBytes of AesProvider in Sharpify now has 2 overloads with 2 parameters, and the compiler seems to trim the wrong one, unless the optional parameter is specified.

  • Also preFilter in Database.Remove() was renamed to keyPrefix to better signify its purpose. this change doesn't alter behavior.

Reminder: Workaround for broken NativeAot support from MemoryPack

As of writing this, MemoryPack's NativeAot support is broken, for any type that isn't already in their cached types, the MemoryPackFormatterProvider uses reflection to get the formatter, which fails in NativeAot. As a workaround, we need to add the formatters ourselves, to do this, take any 1 static entry point, that activates before the database is loaded, and add this:

// for every T type that relies on MemoryPack for serialization, and their inheritance hierarchy
// This includes types that implement IMemoryPackable (i.e types that are decorated with MemoryPackable)
MemoryPackFormatterProvider.Register<T>();
// If the type is a collection or dictionary use the other corresponding overloads:
MemoryPackFormatterProvider.RegisterCollection<TCollection, TElement>();
// or
MemoryPackFormatterProvider.RegisterDictionary<TDictionary, TKey, TValue>();
// and so on...
// for all overloads check peek the definition of MemoryPackFormatterProvider, or their Github Repo

Note: Make sure you don't create a new static constructor in those types, MemoryPack already creates those, you will need to find a different entry point.

With this the serializer should be able to bypass the part using reflection, and thus work even on NativeAot.

P.S. The base type of the Database is already registered the same way on its own static constructor.

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.4.1 55 6/3/2024
2.4.0 54 5/30/2024
2.3.0 92 4/17/2024
2.2.0 101 3/2/2024
2.1.3 88 1/25/2024
2.1.2 77 1/25/2024
2.1.1 80 1/25/2024
2.1.0 79 1/25/2024
2.0.2 78 1/23/2024
2.0.1 78 1/22/2024
2.0.0 83 1/20/2024
1.1.0 89 1/15/2024
1.0.3 99 1/8/2024
1.0.2 102 1/5/2024
1.0.1 94 1/4/2024
1.0.0 93 1/4/2024