Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们可以有一个二维通用列表吗
IList<IList<AbcAuditDto>>
这是一个好方法吗?
这绝对是可能的。这是否是“好方法”取决于您要解决的问题。
是的,你可以有一个列表列表。这是否是一个好方法在很大程度上取决于您要解决的问题。
通过使用某物的列表,您可以让其他开发人员更难看到数据类型并理解其用途。如果您将数据传递给其他类,那么这一点更为重要。
我建议创建一个新类来代替使用嵌套列表。这样,您可以命名列表列表的每个维度,并且更易于使用。