Ejemplo n.º 1
0
        public virtual void Modify <T>(T entity, IModifyCommandInterceptor modifyInterceptor) where T : class
        {
            Check.NotNull(entity, "entity");
            Check.NotNull(modifyInterceptor, "modifyInterceptor");

            modifyInterceptor.Modify(this, CommandRepository.Modify, entity);
        }
        public CommandInterceptors(IModifyCommandInterceptor modifyCommandInterceptor)
            : this()
        {
            Check.NotNull(modifyCommandInterceptor, "modifyCommandInterceptor");

            ModifyCommandInterceptor = modifyCommandInterceptor;
        }
Ejemplo n.º 3
0
        public virtual async Task ModifyAsync <T>(T entity, IModifyCommandInterceptor modifyInterceptor) where T : class
        {
            Check.NotNull(entity, "entity");
            Check.NotNull(modifyInterceptor, "modifyInterceptor");

            await Task.Run(() => Modify(entity, modifyInterceptor));
        }
Ejemplo n.º 4
0
        public CommandInterceptors(IModifyCommandInterceptor modifyCommandInterceptor)
            : this()
        {
            Check.NotNull(modifyCommandInterceptor, "modifyCommandInterceptor");

            ModifyCommandInterceptor = modifyCommandInterceptor;
        }
 protected override void ModifyEntityActioned <T>(T entity, IModifyCommandInterceptor modifyCommandInterceptor)
 {
     modifyCommandInterceptor.Modify(
         this,
         new Action <T>(p =>
     {
         var collectionName = CollectionHelpers.CollectionNameFromEntity(entity);
         var result         = MongoDatabase.GetCollection <T>(collectionName).Save(entity);
         RaiseEvent(new MongoDbEntityModifiedEvent(this, entity, result));
     }),
         entity);
 }
        public DefaultRepositoryInterceptors(IModifyCommandInterceptor modifyCommandInterceptor)
        {
            Check.NotNull(modifyCommandInterceptor, "modifyCommandInterceptor");

            ModifyCommandInterceptor = modifyCommandInterceptor;
        }
        public DefaultRepositoryInterceptors(IModifyCommandInterceptor modifyCommandInterceptor)
        {
            Check.NotNull(modifyCommandInterceptor, "modifyCommandInterceptor");

            ModifyCommandInterceptor = modifyCommandInterceptor;
        }