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; }
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); }
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; }