【发布时间】:2012-09-07 20:39:40
【问题描述】:
我目前有:
public string GetRefStat(int pk) {
return RefStat[pk];
}
private readonly Dictionary<int, int> RefStat =
new Dictionary<int, int>
{
{1,2},
{2,3},
{3,5}
};
这可行,但我唯一一次使用 RefStat 字典是在 GetRefStat 调用它时。
有没有办法可以将方法和字典结合起来?
【问题讨论】:
-
这两个还没有合并到一个类中吗?
标签: c#