情况1:
var lstUsers = MyProgram.GetUsres();
if(lstUsers.Any()){
string ExistingUser = lstUser.First().UserName;
}
案例二:
if(MyProgram.GetUsres().Where(qry => qry.UserName.Lower("xyz").Any()){
string ExistingUser = MyProgram.GetUsres().Where(qry => qry.UserName.Lower("xyz")).First().UserName;
}
请帮助我了解哪种情况可能需要更多时间和内存来运行上述代码?
为什么?