using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Leit.FrameWork.Cache
|
|
{
|
|
public class DictionaryHelper
|
|
{
|
|
public static void DictionaryAddValue<T>(Dictionary<string, T> dic, string key, T value)
|
|
{
|
|
|
|
key = key.Replace(" ", "");
|
|
|
|
if (dic.ContainsKey(key))
|
|
{
|
|
dic[key] = value;
|
|
|
|
}
|
|
else
|
|
{
|
|
dic.Add(key, value);
|
|
}
|
|
}
|
|
|
|
|
|
public static bool DictionaryIsConrainKey<T>(Dictionary<string, T> dic, string key)
|
|
{
|
|
if (dic.ContainsKey(key))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|