我需要使用静态缓存中的国家/地区列表保存类。C#在可访问变量中存储字符串,int,字符串
的数据是建立与
string shortName //Primary Key - (IL or UK for example)
int ID //Unique - has no meaning, but needs to be saved
string longName //(Israel or United Kingdom for example)
我想将其保存在一个字典:
Dictionary<string , Dictionary<int,string>> list = new Dictionary<string, Dictionary<int,string>>();
这是我需要在类的API:
Countries.getByShortName();// I dont know what to return, I'd love some advise
Countries.getById();// I might need that
Countries.getAll();// I dont know what to return, I'd love some advise
你认为处理这个课程的最好方法是什么?
感谢
定义类型来保存你的数据,而不是使用的字典? –
@JeffMercado关心提供一个例子?谢谢 – SexyMF