@@ -119,8 +119,6 @@ public User(GlobalSettings globalSettings, int id, string name, string email, st
119
119
private DateTime _lastPasswordChangedDate ;
120
120
private DateTime _lastLoginDate ;
121
121
private DateTime _lastLockoutDate ;
122
- private IDictionary < string , object > _additionalData ;
123
- private object _additionalDataLock = new object ( ) ;
124
122
125
123
//Custom comparer for enumerable
126
124
private static readonly DelegateEqualityComparer < IEnumerable < int > > IntegerEnumerableComparer =
@@ -366,41 +364,6 @@ public void AddGroup(IReadOnlyUserGroup group)
366
364
}
367
365
}
368
366
369
- public T FromUserCache < T > ( string cacheKey )
370
- where T : class
371
- {
372
- lock ( _additionalDataLock )
373
- {
374
- return AdditionalData . TryGetValue ( cacheKey , out var data )
375
- ? data as T
376
- : null ;
377
- }
378
- }
379
-
380
- public void ToUserCache < T > ( string cacheKey , T vals )
381
- where T : class
382
- {
383
- lock ( _additionalDataLock )
384
- {
385
- AdditionalData [ cacheKey ] = vals ;
386
- }
387
- }
388
-
389
- [ IgnoreDataMember ]
390
- [ DoNotClone ]
391
- [ EditorBrowsable ( EditorBrowsableState . Never ) ]
392
- [ Obsolete ( "This should not be used, it's currently used for only a single edge case - should probably be removed for netcore" ) ]
393
- internal IDictionary < string , object > AdditionalData
394
- {
395
- get
396
- {
397
- lock ( _additionalDataLock )
398
- {
399
- return _additionalData ?? ( _additionalData = new Dictionary < string , object > ( ) ) ;
400
- }
401
- }
402
- }
403
-
404
367
protected override void PerformDeepClone ( object clone )
405
368
{
406
369
base . PerformDeepClone ( clone ) ;
@@ -410,29 +373,6 @@ protected override void PerformDeepClone(object clone)
410
373
//manually clone the start node props
411
374
clonedEntity . _startContentIds = _startContentIds . ToArray ( ) ;
412
375
clonedEntity . _startMediaIds = _startMediaIds . ToArray ( ) ;
413
-
414
- // this value has been cloned and points to the same object
415
- // which obviously is bad - needs to point to a new object
416
- clonedEntity . _additionalDataLock = new object ( ) ;
417
-
418
- if ( _additionalData != null )
419
- {
420
- // clone._additionalData points to the same dictionary, which is bad, because
421
- // changing one clone impacts all of them - so we need to reset it with a fresh
422
- // dictionary that will contain the same values - and, if some values are deep
423
- // cloneable, they should be deep-cloned too
424
- var cloneAdditionalData = clonedEntity . _additionalData = new Dictionary < string , object > ( ) ;
425
-
426
- lock ( _additionalDataLock )
427
- {
428
- foreach ( var kvp in _additionalData )
429
- {
430
- var deepCloneable = kvp . Value as IDeepCloneable ;
431
- cloneAdditionalData [ kvp . Key ] = deepCloneable == null ? kvp . Value : deepCloneable . DeepClone ( ) ;
432
- }
433
- }
434
- }
435
-
436
376
//need to create new collections otherwise they'll get copied by ref
437
377
clonedEntity . _userGroups = new HashSet < IReadOnlyUserGroup > ( _userGroups ) ;
438
378
clonedEntity . _allowedSections = _allowedSections != null ? new List < string > ( _allowedSections ) : null ;
0 commit comments