コード例 #1
0
        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));
        }
コード例 #2
0
        public CommandInterceptors(IDeleteCommandInterceptor deleteCommandInterceptor)
            : this()
        {
            Check.NotNull(deleteCommandInterceptor, "deleteCommandInterceptor");

            DeleteCommandInterceptor = deleteCommandInterceptor;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public CommandInterceptors(IDeleteCommandInterceptor deleteCommandInterceptor)
            : this()
        {
            Check.NotNull(deleteCommandInterceptor, "deleteCommandInterceptor");

            DeleteCommandInterceptor = deleteCommandInterceptor;
        }
        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);
        }
コード例 #6
0
        public DefaultRepositoryInterceptors(IDeleteCommandInterceptor deleteCommandInterceptor)
        {
            Check.NotNull(deleteCommandInterceptor, "deleteCommandInterceptor");

            DeleteCommandInterceptor = deleteCommandInterceptor;
        }
コード例 #7
0
        public DefaultRepositoryInterceptors(IDeleteCommandInterceptor deleteCommandInterceptor)
        {
            Check.NotNull(deleteCommandInterceptor, "deleteCommandInterceptor");

            DeleteCommandInterceptor = deleteCommandInterceptor;
        }