public virtual async Task AddAsync <T>(T entity, IAddCommandInterceptor addInterceptor) where T : class
        {
            Check.NotNull(entity, "entity");
            Check.NotNull(addInterceptor, "addInterceptor");

            await Task.Run(() => Add(entity, addInterceptor));
        }
        public CommandInterceptors(IAddCommandInterceptor addCommandInterceptor)
            : this()
        {
            Check.NotNull(addCommandInterceptor, "addCommandInterceptor");

            AddCommandInterceptor = addCommandInterceptor;
        }
示例#3
0
        public virtual void Add <T>(T entity, IAddCommandInterceptor addInterceptor) where T : class
        {
            Check.NotNull(entity, "entity");
            Check.NotNull(addInterceptor, "addInterceptor");

            addInterceptor.Add(this, Add, entity);
        }
示例#4
0
        public CommandInterceptors(IAddCommandInterceptor addCommandInterceptor)
            : this()
        {
            Check.NotNull(addCommandInterceptor, "addCommandInterceptor");

            AddCommandInterceptor = addCommandInterceptor;
        }
 protected override void AddEntityActioned <T>(T entity, IAddCommandInterceptor addCommandInterceptor)
 {
     addCommandInterceptor.Add(
         this,
         new Action <T>(p =>
     {
         var collectionName = CollectionHelpers.CollectionNameFromEntity(entity);
         var result         = MongoDatabase.GetCollection <T>(collectionName).Insert(entity);
         RaiseEvent(new MongoDbEntityAddedEvent(this, entity, result));
     }),
         entity);
 }
        public DefaultRepositoryInterceptors(IAddCommandInterceptor addCommandInterceptor)
        {
            Check.NotNull(addCommandInterceptor, "addCommandInterceptor");

            AddCommandInterceptor = addCommandInterceptor;
        }
        public DefaultRepositoryInterceptors(IAddCommandInterceptor addCommandInterceptor)
        {
            Check.NotNull(addCommandInterceptor, "addCommandInterceptor");

            AddCommandInterceptor = addCommandInterceptor;
        }