1. C# / Говнокод #22670

    −126

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    public class MobileObjectCache<TKey, TItem> : ConcurrentDictionaryCache<TKey, TItem> where TItem : IIdentified<TKey>, IDataRecordLoadable, new()
    {
        public MobileObjectCache(IdSeries series)
            : base(series)
        {
            
        }
    
        protected override void OnUpdate(TKey key, TItem oldItem, TItem newItem)
        {
            MobileObject mo = oldItem as MobileObject;
            mo.Description = (newItem as MobileObject).Description;
        }
    }

    Главный разработчик знает как правильно расширять Generic-классы.

    Запостил: random12, 25 Марта 2017

    Комментарии (18) RSS

    Добавить комментарий