【发布时间】:2022-03-03 13:36:34
【问题描述】:
我有以下嵌套结构。
List<SomeType> 有另一个List<AnotherType> 列表,内部有一个array of strings users。
public class SomeType
{
public string EmployeeNo { get; set; }
public List<AnotherType> AnotherType { get; set; }
}
public class AnotherType
{
public string UserName { get; set; }
public string[] Users { get; set; }
}
假设我想在字符串Users 的数组中搜索一个值。我该怎么做。
【问题讨论】:
-
必须先显示 SomeType 和 AnotherType 才能回答
-
向我们展示您已经尝试过的代码并解释它是如何失败的,以便我们建议如何修复代码。
-
@pm100 更新了代码
-
“在字符串用户数组中搜索一个值”属于哪个列表或对象?向我们展示样品。