JsonFileWrapper 1.0.0.1
Did not handle NULL objects very well
See the version list below for details.
dotnet add package JsonFileWrapper --version 1.0.0.1
NuGet\Install-Package JsonFileWrapper -Version 1.0.0.1
<PackageReference Include="JsonFileWrapper" Version="1.0.0.1" />
paket add JsonFileWrapper --version 1.0.0.1
#r "nuget: JsonFileWrapper, 1.0.0.1"
// Install JsonFileWrapper as a Cake Addin #addin nuget:?package=JsonFileWrapper&version=1.0.0.1 // Install JsonFileWrapper as a Cake Tool #tool nuget:?package=JsonFileWrapper&version=1.0.0.1
JsonFileWrapper
This is another file I created to explain generic classes for my students. So I created this generic class that loads and saves json objects. All you need to do is to give it the object to use and the filename. Then you can load and save the object while you work on it.
This project is losely based on the Bridge design pattern.
Installation
Use the package manager in Visual Studio to install JsonFileWrapper or use the package-manager window.
install-package JsonFileWrapper
Usage
// Example object
class Person
{
public string Name { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
using MarcusMedinaPro.JsonFileWrapper;
// preparing the object
var file = new JsonFile<List<Person>>("Friends")
{
Data = new List<Person>(),
};
file.Load();
var People = file.Data;
// Now you can use your list as you want
People.Add(new Person{Name="Adam",Lastname="West"});
People.Add(new Person{Name="Bob",Lastname="Hoskins"});
People.Add(new Person{Name="James",Lastname="Woods"});
// Save the list
file.Save();
Source code
You can find the code on my Github account.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Thanks list
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.