c#中怎么实现像Dictionary一样通过D[key]取值呢
public class Configuration<TKey,TValue>
{
private Dictionary<TKey, TValue> _dic = new Dictionary<TKey, TValue>();
public TValue this[TKey key]
{
get
{
return _dic[key];
}
set
{
_dic[key] = value;
}
}
public Configuration()
{
}
}