在什么情况下这段代码会出现 System.StackOverflowException 错误?
Accounts.Sort((x, y) => string.Compare(x.AccountId, y.AccountId));
更新:
该属性写为:
public string AccountId
{
get { return _accountId; }
set { _accountId = value; }
}
没什么特别的。排序也不会被覆盖。
最佳答案
查看调用堆栈,您会看到哪个函数被一遍又一遍地执行。如果这是不可能的(例如,因为它在生产环境中运行),请提供更多信息。
关于被调用的属性调用了什么,这个函数在哪里被调用等
关于C# - System.StackOverflowException 与 Lambda,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2784344/