public class ModelInfo
{
public int AssignedCount { get; set; }
public int UnassignedCount { get; set; }
public int TotalCount { get { return UnassignedCount + TotalCount; } }
}
* 編輯: * 當我使TOTALCOUNT屬性添加UnassignedCount +的TOTALCOUNT把這個代碼,我意識到(我的意思是添加其他兩項罪名一起)。有人可以提供關於SO錯誤發生的原因的全面解釋嗎?我的意思是,低級別的東西。C# - 屬性導致的StackOverflow
Stackoverflowing!
你想知道爲什麼會發生堆棧溢出?無限遞歸就是答案。 'TotalCount'''調用''TotalCount''調用''TotalCount'哪個...你明白了。 –