Isaac.FileStorage
1.6.0
dotnet add package Isaac.FileStorage --version 1.6.0
NuGet\Install-Package Isaac.FileStorage -Version 1.6.0
<PackageReference Include="Isaac.FileStorage" Version="1.6.0" />
paket add Isaac.FileStorage --version 1.6.0
#r "nuget: Isaac.FileStorage, 1.6.0"
// Install Isaac.FileStorage as a Cake Addin
#addin nuget:?package=Isaac.FileStorage&version=1.6.0
// Install Isaac.FileStorage as a Cake Tool
#tool nuget:?package=Isaac.FileStorage&version=1.6.0
Simple file storage solution
This package allows for data storage using serialisation. It utilises a binary JSON-based serialisation to record data in .j2k files (it's a json and it has a key, .j2k is not a joke).
It is a generics-based solution that receives a key that will be used as file name and an <T> object. It utilises the input class structure, so no manual intervention is needed - it'll work with any given object.
Functionalities:
- void Insert(string key, T obj): Allows insertion of a new record. The 'string key' parameter will be used as file name and T object is the data class.
- T Get<T>(string key): Searches a file by name and, if possible, will deserialise to a given T object.
- IEnumerable<string> GetAllKeys(): This method searches for all .jk files and returns all entries.
- void Delete(): Deletes a given key on record.
IMPORTANT NOTE!
From version 0.3 and above, this solution is BSON-based (binary JSON). Nice, huh? It's faster to serialise/deserialise. Also, smaller! The way I see it, it's a win-win, that's why I did it.
Therefore, from now on, files will be saved as .j2k (it used to be a joke, now it's two). - The file extension now is .j2k.
Last, but not least: for those who already use 0.2.x versions of this solution, fear not! I took my sweet time to automatically convert your JSON files (.jk) into BSON binary files (.j2k) upon booting up on a given directory. Additionally, it'll keep a Zip file in there, containing old .jk files. No files need to be deleted.
I know, I know, it's ok. You're welcome.
Also, from version 1.5 and above, it is a .NET 5-based solution.
In version 1.6 I've added a new error message in case of trying to fit data in wrong data types. Helps a lot.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
-
net5.0
- Newtonsoft.Json (>= 12.0.3)
- Newtonsoft.Json.Bson (>= 1.0.2)
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.6.0 | 452 | 3/8/2022 | |
1.5.0 | 383 | 3/8/2022 | |
1.3.0 | 326 | 2/16/2021 | |
1.1.0 | 388 | 3/8/2022 | |
1.0.0 | 338 | 1/24/2021 | |
0.3.4 | 348 | 1/15/2021 | |
0.3.3 | 329 | 1/15/2021 | |
0.3.2 | 424 | 1/10/2021 | |
0.3.1 | 489 | 1/9/2021 | |
0.2.5 | 595 | 1/6/2021 | |
0.2.4 | 572 | 1/6/2021 | |
0.2.3 | 369 | 1/6/2021 | |
0.2.2 | 388 | 1/6/2021 | |
0.2.1 | 491 | 1/6/2021 | |
0.2.0 | 612 | 1/5/2021 |
Basically, version 1.0 is a well-tested version (both in daily usage and unit tests) and removed some unnecessary stuff. The only major change from version 0.x is that I changed the class name from Core to FileStorageEngine to be more intuitive.