Often times when writing apps, I hate writing framework code to support persisting objects and structures to disk. So, I wrote a quick and dirty little library that allows you to persist and restore any object from disk. It’s made available in open-source form under the zlib license written in C#. There are three commands, Put, Get and Delete. Put takes an arbitrary object and saves it, Get retrieves all objects of the type given to it and Delete deletes and instance of an object.
// create a persistance manager
PersistManager mgr = new PersistManager();
// create a few classes I want to save
ExampleClass example1 = new ExampleClass();
ExampleClass example2 = new ExampleClass();
example2.Firstname = “Otherfname”;
example2.Lastname = “otherlastname”;
// save them down
// get them back
object saved = mgr.Get(typeof(ExampleClass));
foreach(ExampleClass o in saved)
Download SimplePersist v1.0.