lith 5 rokov pred
rodič
commit
d767e1c4b4

+ 1 - 1
dotnet/Sers/Sers.Core/Sers.Core/Module/Api/RouteMap/GenericRouteMap.cs

@@ -102,7 +102,7 @@ namespace Sers.Core.Module.Api.RouteMap
                 {
                     tree = new Tree<T> { key = path[index], parent = this };
 
-                    children.TryAdd(tree.key, tree);                                    
+                    children.IDictionaryTryAdd(tree.key, tree);                                    
                 }
                 return tree.BuildPath(path, index + 1);
             }

+ 1 - 1
dotnet/Sers/Sers.ServiceCenter/Sers.Gover/Base/Extensions/ApiNodeExtensions.cs

@@ -55,7 +55,7 @@ namespace Vit.Extensions
                 reasons = new Dictionary<string, string>();
                 data.SetData("StopReason", reasons);
             }
-            reasons.TryAdd(reason, reason);            
+            reasons.IDictionaryTryAdd(reason, reason);            
         }
         /// <summary>
         /// 返回 移除后是否仍有StopReason

+ 4 - 6
dotnet/Vit/Vit.Core/Vit.Core/Extensions/DictionaryExtensions.cs → dotnet/Vit/Vit.Core/Vit.Core/Extensions/IDictionaryExtensions.cs

@@ -1,13 +1,11 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 
 namespace Vit.Extensions
 {
-    public static partial class DictionaryExtensions
+    public static partial class IDictionaryExtensions
     {
 
-        #region TryAdd
+        #region IDictionaryTryAdd
 
         /// <summary>
         /// 
@@ -18,7 +16,7 @@ namespace Vit.Extensions
         /// <param name="key"></param>
         /// <param name="value"></param>
         /// <returns></returns>
-        public static bool TryAdd<TKey, TValue>(this IDictionary<TKey, TValue> data, TKey key, TValue value)
+        public static bool IDictionaryTryAdd<TKey, TValue>(this IDictionary<TKey, TValue> data, TKey key, TValue value)
         {
             if (data == null || data.ContainsKey(key))
             {