void ZNodeManager_NodeWhisperEvent(object sender, ZyreEventWhisper e) { try { var eventData = e.ConvertTo<ZNodeEntry>(); var commandInfo = DLiteUtil.Analyze(eventData.Command); var args = eventData.Entry as object[]; object obj = this; if (!commandInfo.Provider.Equals(Name)) { obj = GetCollection(commandInfo.Provider); ; } var method = obj.FindMethod(commandInfo.Action, ref args); if (method == null) return; var key = DLiteUtil.BuildKey(new object[] { eventData.Command }.Concat(args)); DLiteUtil.OffRaiser(key); method.Invoke(obj, args); } catch (Exception ex) { Logger.Error(ex); } }
public bool DropCollection(string name) { DLiteUtil.Whisper(Name, "DropCollection", new object[] { name }); return db.Value.DropCollection(name); }
public bool RenameCollection(string oldName, string newName) { DLiteUtil.Whisper(Name, "RenameCollection", new object[] { oldName, newName }); return db.Value.RenameCollection(oldName, newName); }
public int Delete(Query query) { DLiteUtil.Whisper(Name, "Delete", new object[] { query }); return(LiteCollection.Delete(query)); }
public bool DropIndex(string name) { DLiteUtil.Whisper(Name, "DropIndex", new object[] { name }); return(LiteCollection.DropIndex(name)); }
public bool Delete(BsonValue id) { DLiteUtil.Whisper(Name, "Delete", new object[] { id }); return(LiteCollection.Delete(id)); }
public int Delete(Expression <Func <T, bool> > predicate) { DLiteUtil.Whisper(Name, "Delete", new object[] { predicate }); return(LiteCollection.Delete(predicate)); }
public int Update(IEnumerable <T> entities) { DLiteUtil.Whisper(Name, "Update", new object[] { entities }); return(LiteCollection.Update(entities)); }
public bool Update(T entity) { DLiteUtil.Whisper(Name, "Update", new object[] { entity }); return(LiteCollection.Update(entity)); }
public bool Update(BsonValue id, T entity) { DLiteUtil.Whisper(Name, "Update", new object[] { id, entity }); return(LiteCollection.Update(id, entity)); }
public int InsertBulk(IEnumerable <T> entities, int batchSize = 5000) { DLiteUtil.Whisper(Name, "InsertBulk", new object[] { entities, batchSize }); return(LiteCollection.InsertBulk(entities, batchSize)); }
public BsonValue Insert(T entity) { DLiteUtil.Whisper(Name, "Insert", new object[] { entity }); return(LiteCollection.Insert(entity)); }
public int Insert(IEnumerable <T> entities) { DLiteUtil.Whisper(Name, "Insert", new object[] { entities }); return(LiteCollection.Insert(entities)); }
public void Insert(BsonValue id, T entity) { DLiteUtil.Whisper(Name, "Insert", new object[] { id, entity }); LiteCollection.Insert(id, entity); }