我们可以有二维通用列表吗?

发布于 2024-10-06 02:47:10 字数 102 浏览 0 评论 0原文

我们可以有一个二维通用列表

IList<IList<AbcAuditDto>>

这是一个好方法吗?

Can we have a two dimensional generic list

IList<IList<AbcAuditDto>>

Is it a good approach ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

装纯掩盖桑 2024-10-13 02:47:10

这绝对是可能的。这是否是一个“好方法”取决于您要解决的问题。

It's definitely possible. Whether it's a "good approach" or not depends on the problem you are trying to solve.

爱冒险 2024-10-13 02:47:10

是的,你可以有一个列表的列表。这是否是一个好的方法在很大程度上取决于您要解决的问题。

Yes, you can have a list of lists. Whether this is a good approach depends heavily on the problem that you're trying to solve.

眼眸里的那抹悲凉 2024-10-13 02:47:10

通过使用某项列表的列表,其他开发人员更难查看该数据类型并理解其用途。如果您要将数据传递给其他类,那么这一点就更重要了。

我建议创建一个新类来代替使用嵌套列表。通过这种方式,您可以命名列表列表的每个维度,并且更容易使用。

By using a list of lists of something, you make it more difficult for other developers to see the data type and understand its use. If you are passing the data to other classes, then this is even more important.

I would recommend creating a new class in place of using nested lists. This way you can name each dimension of your list of lists and it is easier to work with.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文