我們有這樣的代碼:ServiceStack JSONSerializer和HashSet的<x>
// using ServiceStack JSONSerializer
string typeInfoString = JsonSerializer.SerializeToString<Type>(typeof(HashSet<string>));
// yields "System.Collections.Generic.HashSet`1[[System.String, mscorlib]], System.Core"
// this string is the same thing, so it's probably valid json
string jsonTypeInfo = typeof(HashSet<string>).ToJson();
// this should work, I feel like
Type desType = JsonSerializer.DeserializeFromString<Type>(jsonTypeInfo);
// but desType ends up being null :(
是否有關於HashSet的類型有些ServiceStack疑難雜症?
謝謝,我會去做那個 – welegan