-2
我想尽量将它转换为lambda,但无法成功。有没有什么方法可以转换为linq或lambda?嵌套的foreach循环转换为lambda或linq
foreach (var tempitem in mbsRateTempList)
{
foreach (var Saveditem in mbsSavedRecordList)
{
if (tempitem.MbsSecurityId == Saveditem.MbsSecurityId && tempitem.CouponRate == Saveditem.CouponRate
&& tempitem.SettlementMonth.Month == Saveditem.SettlementMonth.Month && tempitem.Price == Saveditem.Price)
{
TobeDeletedIds.Add(Saveditem.Id);
MatchedIdsInTempList.Add(tempitem.TempId);
//mbsSavedRecordList[0].ObjectState=Repository.Pattern.Base.Infrastructure.ObjectState.
}
//else
//{
//}
}
}
欢迎堆栈溢出。请举例说明您正在使用的数据,您拥有的代码实体以及您得到的错误。编辑你的问题是可以的。 –