chr
2025-03-04 3f62d18e4361cd1d7a49c126765d95b2ad9c8246
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Collections.Generic;
 
namespace PdmSwPlugin.Common.Util
{
    public static class DictionaryUtil
    {
        public static T Get<T>(this Dictionary<string, T> dict, string key, T defaultValue = default)
        {
            if (key == null)
            {
                return defaultValue;
            }
            if (dict == null || !dict.ContainsKey(key))
            {
                return defaultValue;
            }
            return dict[key];
        }
    }
}