Example #1
0
        protected override void RemoveItem(int index)
        {
            var item = this[index];

            ItemDeleting?.Invoke(this, new ItemDeletingEventArgs <TItem>(index, item));
            base.RemoveItem(index);
        }
Example #2
0
 public virtual void Delete <TEntity>(IEnumerable <TEntity> collection) where TEntity : class, new()
 {
     foreach (var entity in collection)
     {
         DataContext.Set <TEntity>().Remove(entity);
         ItemDeleting?.Invoke(entity);
     }
 }
Example #3
0
        public virtual void DeleteOne <TEntity>(params object[] keys) where TEntity : class, new()
        {
            var value = CreateKeyEntity <TEntity>(keys);

            var entry = GetEntryByKey(value);

            entry.State = EntityState.Deleted;

            ItemDeleting?.Invoke(value);
        }