Exemplo n.º 1
0
        public void Add <TEntity>(IEntityWatcher <TEntity> entityWatcher) where TEntity : Core.IEntity
        {
            var entityType = typeof(TEntity);

            if (!_internalDictionary.ContainsKey(entityType))
            {
                _internalDictionary.Add(entityType, new List <IEntityWatcher>());
            }
            _internalDictionary[entityType].Add(entityWatcher);
        }
Exemplo n.º 2
0
        public void Remove <TEntity>(IEntityWatcher <TEntity> entityWatcher) where TEntity : Core.IEntity
        {
            var entityType = typeof(TEntity);

            if (!_internalDictionary.ContainsKey(entityType))
            {
                return;
            }
            if (_internalDictionary[entityType].Count == 0)
            {
                return;
            }

            _internalDictionary[entityType].Remove(entityWatcher);
        }