Skip to content

Instantly share code, notes, and snippets.

@RestoreMonarchy
RestoreMonarchy / DataStorage.md
Last active March 31, 2021 14:30
Saving data to json file

DataStorage is a simple class I'm using in my plugins to save data in json file

public class DataStorage<T> where T : class
{
    public string DataPath { get; private set; }
    public DataStorage(string dir, string fileName)
    {
        DataPath = Path.Combine(dir, fileName);
    }