public static TokenDictionary ToTokens(this IDictionary <string, string> origin) { if (origin == null) { return(null); } var result = new TokenDictionary(); result.AddBatch(origin.Select(kv => KeyValuePair.Create(kv.Key, Token.FromString(kv.Value)))); return(result); }