Skip to content

mahmoud-drwsh/JsonDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonDB

consider the Following

class File {
public string Name { get; set; }
}

Examples

using JsonDB;
...

//provide a directory for the database to save .json files to
//if no directory is provided the directory will be ".\Data\"
var db = new Database(Environment.GetFolderPath(Environment.SpecialFolder.Desktop));

//just start inserting anything and it will create a .json file for that specific type in the directory given above
//notice that a type is required
db.InsertOne<File>(new File() { Name = "NewFile" });
//you can also insert a list of Files
db.InsertMany<File>(new List<File>() { new File() { Name = "File1" }, new File() { Name = "File2" } });

//when you call GetCollection<T>(); it will return a List<T> filled with what was inserted of the type given
var FilesCollection = db.GetCollection<File>();

//to delete a record you have to use linq just provide proper filter to delete
//all matching items will be deleted
db.Delete<File>(f => f.Name == "NewFile");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages