public void RemoveBrokenLinks(CommandSystem.ExecutionInformation info) { using (var trans = database.BeginTrans()) { const int iterations = 3; var currentIter = audioLogEntries.FindAll(); for (int i = 0; i < iterations; i++) { info.Write("Filter iteration " + i); currentIter = FilterList(info, currentIter); } foreach (var entry in currentIter) { RemoveEntry(entry); info.Bot.PlaylistManager.AddToTrash(new PlaylistItem(entry.AudioResource)); info.Write($"Removed: {entry.Id} - {entry.AudioResource.ResourceTitle}"); } trans.Commit(); } }
public Dictionary <string, T> GetDictionary() { try { lock (_lock) { using (var db = new LiteDatabase(_dataBaseFile)) { _fileHashCollection = db.GetCollection <FileHashTableEntry <T> >(_databaseName); FileHashTableEntry <T>[] all = _fileHashCollection.FindAll().ToArray(); return(all.ToDictionary(fileHashTableContent => fileHashTableContent.Key, fileHashTableContent => fileHashTableContent.Tag)); } } } catch (Exception ex) { _logger.Error("LifeTimeStorage.GetDictionary() - " + ex.Message); return(null); } }
public void LoadTenantsFromDump() { try { _log.Debug("LoadTenantsFromDump()"); lock (_locker) { var list = _tenants.FindAll().ToList(); foreach (var tenantData in list) { AddTenantToCache(tenantData, false); } } } catch (Exception ex) { _log.Error("LoadTenantsFromDump: {0}", ex.ToString()); ReCreateDump(); } }
public MOTR_Sessions(MOTR_Users Users) { //Storing the users variable, used to check the ID etc.. m_Users = Users; aTemporarySessions = new ArrayList(); //WindowsService.LogEventInformation("Starting to read sessions..."); //Opening the database string sGlobalPath = MOTR_Settings.GetGlobalApplicationPath(); m_db = new LiteDatabase(sGlobalPath + @"\Sessions.db"); //Check for expired sessions LiteCollection <SessionStruct> aDBValues = m_db.GetCollection <SessionStruct>("session"); foreach (SessionStruct item in aDBValues.FindAll()) { if (SessionExpired(item.sLastUsed)) { RemoveSession(item.sID); } } }
public void RemoveBrokenLinks(UserSession session) { using (var trans = database.BeginTrans()) { const int iterations = 3; var currentIter = audioLogEntries.FindAll(); for (int i = 0; i < iterations; i++) { session.Write("Filter iteration " + i, true); currentIter = FilterList(session, currentIter); } foreach (var entry in currentIter) { RemoveEntry(entry); session.Bot.PlaylistManager.AddToTrash(new PlaylistItem(entry.AudioResource)); session.Write($"Removed: {entry.Id} - {entry.AudioResource.ResourceTitle}", true); } trans.Commit(); } }
public Task ListRegisteredUsers() { LiteCollection <Streamer> db = null; lock (dbLock) { db = database.GetCollection <Streamer>("streamers"); } if (db == null) { ReplyAsync("Could not access users in database"); return(Task.CompletedTask); } List <string> users = new List <string>(); foreach (var s in db.FindAll()) { users.Add(s.Name); } return(ReplyAsync($"[ {string.Join(", ", users)} ]")); }
public void ModificaBot_Clicked(object sender, EventArgs e) { LiteCollection <Bot> Bots = _dataBase.GetCollection <Bot>(); if (Bots.Count() > 0) { var bot = Bots.FindAll().FirstOrDefault(); bot.Nome = "Renato Groffe"; Bots.Upsert(bot); Stream stream = GetImageStreamFromUrl("http://azureweekexperience.azurewebsites.net/wp-content/uploads/2017/06/Renato-Grofe.jpg"); if (stream != null) { //Verfica se ja existe a imagem,se existir apaga if (_dataBase.FileStorage.Exists(bot.BotId.ToString())) { _dataBase.FileStorage.Delete(bot.BotId.ToString()); } _dataBase.FileStorage.Upload(bot.BotId.ToString(), "Teste", stream); } lbStatusBot.Text = "Bot modificado"; } }
public IEnumerable <Minyan> getMinyanim() { return(mMinyan.FindAll()); }
public List <Group> getAllGroups() { return(groups.FindAll().ToList()); }
public List <PortalInfo> getAll() { return(AllPortals.FindAll().ToList()); }
public virtual Task <TUser> FindAsync(UserLoginInfo login) { return(Task.FromResult(_Users.FindAll().FirstOrDefault(u => u.Logins != null && u.Logins.Any(l => l.LoginProvider == login.LoginProvider && l.ProviderKey == login.ProviderKey)))); }
public virtual IEnumerable <T> List() { return(collection.FindAll()); }
//Get All Persons public List <Person> GetAllPersons() { var persons = new List <Person>(personCollection.FindAll()); return(persons); }
public IEnumerable <T> FindAll() { return(_lite.FindAll()); }
public IEnumerable <string> EnlistItems() { return(System.Linq.Enumerable.Select(_Items.FindAll(), s => s.Name)); }
protected virtual IEnumerable <DocumentReference> GetAllItem(LiteCollection <BsonDocument> liteCollection) { return(LiteCollection.FindAll().Select(bsonDocument => new DocumentReference(bsonDocument, this))); }
public void PersonListBindDataGrid(LiteCollection <Personel> _personalListItemsCollection) { var personAllList = _personalListItemsCollection.FindAll().ToList(); dgpersonellist.DataSource = personAllList; }
public IEnumerable <MailContentEntity> FindAll() { return(_mailContentEntity.FindAll()); }
public IEnumerable <T> FindAll(Func <T, bool> condition = null) { return(condition == null?_data.FindAll() : _data.Find(x => condition(x))); }
public IEnumerable <WebPush.PushSubscription> GetAll() { return(_subscriptions.FindAll()); }
public IEnumerable <Room> GetRooms() { return(rooms.FindAll().ToList().OrderBy(r => r.Name)); }
public IEnumerable <User> getUsers() { return(mUsers.FindAll()); }
/// <inheritdoc /> public IEnumerable <TDoc> GetAll() { return(_documents.FindAll()); }
/// <summary> /// Returns all elements of the collection. /// </summary> /// <returns></returns> public virtual IEnumerable <T> GetAll() { var results = cmCollection.FindAll(); return(results); }
private void FetchTodos(FetchTodosAction action) { action.Todos = _todoCollection.FindAll(); }
public IReadOnlyList <T> GetAll() { return(_collection.FindAll().ToList()); }
/// <summary> /// Queryable object for fetching more than one document, or complex searching. /// </summary> /// <returns>Queryable LiteCollection of all documents</returns> public IEnumerable <T> GetAll() { return(Collection.FindAll()); }
public virtual IEnumerable <T> ReadAllItems() { var all = _collection.FindAll(); return(new List <T>(all)); }
public IEnumerable <AuditEvent> GetAllEvents() { LiteCollection <AuditEvent> col = db.GetCollection <AuditEvent>(auditCollectionName); return(col.FindAll()); }
public IEnumerable <DeviceIdBufferedJobLink> GetDeviceIdBufferedJobLinks() { return(DeviceIdBufferedJobLinksBase.FindAll()); }