Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 885 Bytes

README.md

File metadata and controls

30 lines (26 loc) · 885 Bytes

VersionedCollections

A library for Collections with Versions, keeping track of the full Collection History, allowing for operations to get the state of a Collection during a previous Version.

Usage

VersionedDictionary

Create your dictionary

var dictionary = new VersionedDictionary<string, string>();

Add and Remove items

dictionary.Add("key", "value");
dictionary.Remove("key");
dictionary.Add("key", "value2");

Get the state of the dictionary at the latest, or a previous version

dictionary["key"]; // "value2"
dictionary[1, "key"]; // "value"

Get the state of the dictionary at a specific version, flattened.

dictionary.GetDictionary(1); // { "key", "value" }
dictionary.GetDictionary(2); // { }
dictionary.GetDictionary(3); // { "key", "value2" }
dictionary.GetDictionary();  // { "key", "value2" }