public virtual async Task DeleteAsync <T>(T entity, IDeleteCommandInterceptor deleteStrategy) where T : class { Check.NotNull(entity, "entity"); Check.NotNull(deleteStrategy, "deleteStrategy"); await Task.Run(() => Delete(entity, deleteStrategy)); }
public CommandInterceptors(IDeleteCommandInterceptor deleteCommandInterceptor) : this() { Check.NotNull(deleteCommandInterceptor, "deleteCommandInterceptor"); DeleteCommandInterceptor = deleteCommandInterceptor; }
public virtual void Delete <T>(T entity, IDeleteCommandInterceptor deleteStrategy) where T : class { Check.NotNull(entity, "entity"); Check.NotNull(deleteStrategy, "deleteStrategy"); deleteStrategy.Delete(this, Delete, entity); }
protected override void DeleteEntityActioned <T>(T entity, IDeleteCommandInterceptor deleteCommandInterceptor) { deleteCommandInterceptor.Delete( this, new Action <T>(p => { var bsonValue = MongoDbOverridables.Instance.GetBsonIdValueFromEntity(entity); var mongoQuery = Query.EQ("_id", bsonValue); var collectionName = CollectionHelpers.CollectionNameFromEntity(entity); var result = MongoDatabase.GetCollection <T>(collectionName).Remove(mongoQuery, RemoveFlags.Single); RaiseEvent(new MongoDbEntityDeletedEvent(this, entity, result)); }), entity); }
public DefaultRepositoryInterceptors(IDeleteCommandInterceptor deleteCommandInterceptor) { Check.NotNull(deleteCommandInterceptor, "deleteCommandInterceptor"); DeleteCommandInterceptor = deleteCommandInterceptor; }