public int GetSize() { int size = 1 // IsNewEntity + 8 // LastGetDate + 4 // GetCount + 4 // SaveCount + 8 // LastSaveDate + 8 // LastChangeDate + 8 // Generation + 8 // _lockObj + 1 // Unloaded + 32 // Request + 8 // LastSavedData + 8; // CurrentData if (CurrentData != null) { size += CurrentData.GetCacheSize(); } if (LastSavedData != null && ReferenceEquals(LastSavedData, CurrentData) == false) { size += LastSavedData.GetCacheSize(); } return(size); }