public static void EnsureDictionary <TKey, TValue>() { Ensure(() => { var a = new Dictionary <TKey, TValue>(); FormatterCache <Dictionary <TKey, TValue> > .Register(new DictionaryFormatter <TKey, TValue>()); }); }
public static void EnsureList <T>() where T : new() { Ensure(() => { var a = new List <T>(); FormatterCache <T> .Register(new ObjectFormatter <T>()); FormatterCache <T[]> .Register(new ArrayFormatter <T>()); FormatterCache <List <T> > .Register(new ListFormatter <T>()); }); }