コード例 #1
0
 /// <summary>
 /// Ensure generic dictionary type can be (de)deserializable on AOT environment.
 /// </summary>
 /// <typeparam name="TKey">The type of the keys in the dictionary.</typeparam>
 /// <typeparam name="TValue">The type of the values in the dictionary.</typeparam>
 public static void EnsureDictionary <TKey, TValue>()
 {
     Ensure(() =>
     {
         var a = new Dictionary <TKey, TValue>();
         var b = new DictionaryWrapper <TKey, TValue>((IDictionary)null);
         var c = new DictionaryWrapper <TKey, TValue>((IDictionary <TKey, TValue>)null);
     });
 }
コード例 #2
0
 /// <summary>
 /// Ensure generic dictionary type can be (de)deserializable on AOT environment.
 /// </summary>
 /// <typeparam name="TKey">The type of the keys in the dictionary.</typeparam>
 /// <typeparam name="TValue">The type of the values in the dictionary.</typeparam>
 public static void EnsureDictionary <TKey, TValue>()
 {
     Ensure(() =>
     {
         var a = new Dictionary <TKey, TValue>();
         var b = new DictionaryWrapper <TKey, TValue>((IDictionary)null);
         var c = new DictionaryWrapper <TKey, TValue>((IDictionary <TKey, TValue>)null);
         var d = new DefaultContractResolver.EnumerableDictionaryWrapper <TKey, TValue>((IDictionary <TKey, TValue>)null);
     });
 }