Skip to content

dvGomez/JsonCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json Cache (.net)

This library helps you to save any kind of entity inside a .db file in Json format.

Installation

JsonCache is available on Nuget.

dotnet add package JsonCache

Use --version to specify a preview version to install.

Basic Usage

Instance of JsonCache

CacheService cs = new CacheService();

Create and save an entity

var user = new User();
user.Name = "Test User";
	
await cs.SaveAsync(user);

Create and save a list of entities

var userList = new List<User>(...);
	
await cs.SaveAllAsync(userList);

Get Objects

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.

Delete by specific object key

await cs.DeleteByKeyAsync<User>(x => x.Name == "Test User");

Clear Cache

Warning: this methods clear all data from specified object type.

await cs.ClearAsync<User>();

Contributing

We welcome community pull requests for bug fixes, enhancements, and documentation.

About

C# Local Cache based on Json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages