This library helps you to save any kind of entity inside a .db file in Json format.
JsonCache is available on Nuget.
dotnet add package JsonCache
Use --version to specify a preview version to install.
CacheService cs = new CacheService();
var user = new User();
user.Name = "Test User";
await cs.SaveAsync(user);
var userList = new List<User>(...);
await cs.SaveAllAsync(userList);
Using th key of object:
await cs.GetByKeyAsync<User>(x => x.Name == "Test User");
Get all objects:
await cs.GetAllASync<User>();
Return null if not find the object.
await cs.DeleteByKeyAsync<User>(x => x.Name == "Test User");
Warning: this methods clear all data from specified object type.
await cs.ClearAsync<User>();
We welcome community pull requests for bug fixes, enhancements, and documentation.