还有一个警告,我对此很生气:
List<List<string>> allowed = AllowedSCACSwaps;
foreach (List<string> c in allowed.Where(c => c.Contains(scac)))
{
csc = openCycles.FirstOrDefault(icsc => (icsc.CustomerCode == customerCode) && c.Contains(icsc.SCAC));
if (null != csc)
{
return csc;
}
}
说“客户代码的隐式关闭”
string cc = customerCode.ToUpperInvariant();
string sc = scac.ToUpperInvariant(); List<List<string>> allowed = AllowedSCACSwaps;
foreach (List<string> c in allowed.Where(c => c.Contains(sc)))
{
csc = openCycles.FirstOrDefault(icsc => (icsc.CustomerCode == cc) && c.Contains(icsc.SCAC));
if (null != csc)
{
return csc;
}
}
没问题。
我发疯的原因?
scac 和 customerCode 都是传入该方法的字符串。但即使我用 cc 替换了 customerCode,我仍然收到同样的警告。
关闭实际上已经结束了 scac,但 Resharper 误报了它。