首页 > 解决方案 > 需要有关此列表逻辑的帮助,不确定如何编写?

问题描述

我有两个列表,我想避免索引,我需要在 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 函数

标签: c#asp.net-mvclinqasp.net-corelambda

解决方案


推荐阅读