c# - 需要有关此列表逻辑的帮助,不确定如何编写?
问题描述
我有两个列表,我想避免索引,我需要在 lambda 中实现以下功能
List<object> List1 = new List<object>()
List<object> List2 = new List<object>()
List1.Add(new Someclass1().someFunction1(3));
List1.Add(new Someclass1().someFunction1(4));
List2.Add(new Someclass1().someFunction1(3));
List2.Add(new Someclass1().someFunction1(4));
//currently i'm doing like this below
await List1[0].somemethod(logger, List2[0]); // i could like to avoid index
await List1[1].somemethod(logger, List2[0]);
我有一个两个列表对象,其中包含一个函数指针引用,我需要将其转换为 lambda 表达式。thoes 列表包含一个委托方法,所以我必须使用 where bcoz 那个 void 函数
解决方案
推荐阅读
- ios - Xcode if 语句从不识别活动编译条件
- android - Flutter AppUpdateService 链接到死亡
- python - 如果元素不存在,则使用 getElementsByTagName 跳过元素
- css - 使用滑块 Angular 平滑颜色变化
- python - Google Drive API Quickstart.py 错误 400:redirect_uri_mismatch
- reactjs - 如何在反应打字稿的导航栏中创建动态元素
- python-3.x - Poppler pdftohtml.exe 无法通过 IIS7 加载
- javascript - 返回 NaN 的 Javascript 函数
- javascript - 检测 HTML 是否进入视口
- android - 如何让用户出现在 Firebase 后端?