ToolBX.FileGuy
2.0.0-beta1
See the version list below for details.
dotnet add package ToolBX.FileGuy --version 2.0.0-beta1
NuGet\Install-Package ToolBX.FileGuy -Version 2.0.0-beta1
<PackageReference Include="ToolBX.FileGuy" Version="2.0.0-beta1" />
paket add ToolBX.FileGuy --version 2.0.0-beta1
#r "nuget: ToolBX.FileGuy, 2.0.0-beta1"
// Install ToolBX.FileGuy as a Cake Addin #addin nuget:?package=ToolBX.FileGuy&version=2.0.0-beta1&prerelease // Install ToolBX.FileGuy as a Cake Tool #tool nuget:?package=ToolBX.FileGuy&version=2.0.0-beta1&prerelease
FileGuy
High-level API for saving and loading files.
Setup
With [AutoInject]
Congratulations! You have no additional setup to perform beyond AutoInject's initial setup and can use FileGuy right outside the box after installing the package.
Without [AutoInject]
Use the following extension method in your initialization code :
services.AddFileGuy();
Getting started
Compression
FileGuy doesn't use compression by default but does provides you with the option to compress and decompress your file using gzip's algorithm.
Just look for the CompressionLevel property in FileSaveOptions (or FileSerializerOptions if you're using one of the FileSerializers.)
var options = new FileSaveOptions { CompressionLevel = CompressionLevel.Optimal };
Default options
Using appsettings.json to setup default file saving behavior for your entire project so you don't have to pass options all the time.
FileGuy.Json
Adds a FileSerializer service which takes advantage of FileGuy's features to serialize objects to file using Microsoft's System.Text json library.
FileGuy.Newtonsoft
Similar to FileGuy.Json except that it uses Newtonsoft's json libraries (Json.Net) to achieve serialization.
Why choose FileGuy.Newtonsoft over FileGuy.Json?
At this point in time, Newtonsoft's json serialization is already part of many already-existing project. It is still going strong as the number one json library for .NET despite Microsoft's attempts to overshadow it with System.Text.
I'm not taking sides here as I believe both are very solid tools. I'm not going to tell you to choose System.Text over Newtonsoft for new projects either since Newtonsoft should still be considered.
What I'm saying is : Find out for yourself which one works best for you and go with it.
As of 2022, Newtonsoft still has a lot more features but System.Text has more performance. In other words; I don't think either one completely trumps the other and/or renders it obsolete.
If you still don't know which one to go for then- I don't know- just flip a coin?
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 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net7.0
- ToolBX.AutoInject (>= 2.0.0-beta1)
- ToolBX.NetAbstractions (>= 2.0.0-beta1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ToolBX.FileGuy:
Package | Downloads |
---|---|
ToolBX.FileGuy.Newtonsoft
Adds a FileSerializer service which takes advantage of FileGuy's features to serialize objects to file using Newtonsoft's Json.NET library. |
|
ToolBX.FileGuy.Json
Adds a FileSerializer service which takes advantage of FileGuy's features to serialize objects to file using Microsoft's System.Text json library. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 128 | 9/27/2024 |
3.0.0-beta1 | 96 | 9/23/2024 |
2.2.0 | 203 | 1/13/2024 |
2.2.0-beta2 | 116 | 1/11/2024 |
2.2.0-beta1 | 141 | 1/7/2024 |
2.0.2 | 243 | 6/19/2023 |
2.0.1 | 282 | 4/27/2023 |
2.0.0 | 421 | 11/12/2022 |
2.0.0-beta1 | 181 | 10/7/2022 |
1.0.3 | 644 | 10/7/2022 |
1.0.1 | 424 | 5/19/2022 |
1.0.0 | 648 | 5/16/2022 |