/// <summary> /// Adds an <see cref="VQuery"/>. /// </summary> /// <param name="query">The <see cref="VQuery"/>, that should be added.</param> public void AddQuery(VQuery query) { this.Queries.Add(query); this.OnQueryAdded(query); if (this.lastSavedQueryIndex < this.Queries.Count) { _ = this.UploadRemainingQueriesAsync(); } }
private async Task UploadQueryAsync(VQuery query) { using NpgsqlCommand command = query.Command.Invoke(await this.serverConnections.GetConnectionAsync().ConfigureAwait(false)); using DbDataReader reader = await command.ExecuteReaderAsync().ConfigureAwait(true); if (reader.HasRows) { await reader.ReadAsync().ConfigureAwait(true); query.Action?.Invoke(reader); } query.IsSaved = true; }
/// <summary> /// Invokes the QueryAdded event of the <see cref="VQuerySchedule"/>. /// </summary> /// <param name="query">The <see cref="VQuery"/>, that was added.</param> protected virtual void OnQueryAdded(VQuery query) { this.QueryAdded?.Invoke(query); }