我怎样才能缩短名单,LT;名单< KeyValuePair<字符串,字符串>>&GT ;? [英] How can I shorten List<List<KeyValuePair<string, string>>>?

查看:170
本文介绍了我怎样才能缩短名单,LT;名单< KeyValuePair<字符串,字符串>>&GT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要存储在一个结构轻巧键值对列表中的列表。这似乎太麻烦了。什么是好?是否列表与LT;字典<字符串,字符串>>增加多少顶置?还有什么其他选项

I want to store an list of key value pair lists in a lightweight structure. This seems too cumbersome. What's better? Does List<Dictionary<string, string>> add much a overhead? What other options are available?

推荐答案

考虑使用别名的简写:

namespace Application
{
    using MyList = List<List<KeyValuePair<string, string>>>;

    public class Sample
    {
        void Foo()
        {
            var list = new MyList();
        }
    }
}

这篇关于我怎样才能缩短名单,LT;名单&LT; KeyValuePair&LT;字符串,字符串&GT;&GT;&GT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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