C#字典的命名约定 [英] Naming convention for a C# Dictionary

查看:233
本文介绍了C#字典的命名约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何命名字典变量?

How do we name a dictionary variable?

用我的方法说,我有Dictionary<string, List<string>> dictionary;,其中dictionary的键是国家/地区名称,值是省/州名称列表.我应该如何重命名dictionary?

Say in my method I have Dictionary<string, List<string>> dictionary;, where the keys of the dictionary are country names and the values are lists of province/state names. How should I rename dictionary?

我知道我们可以为该示例创建一个Country类.但是请不要提及这种替代方法,因为我在这里考虑的是良好的命名约定.

I know we can create a Country class for this example. But please don't mention this alternative because I'm thinking of good naming convention here.

推荐答案

ProvincesByCountry

这篇关于C#字典的命名约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆