From c9f13c9d76774dbf3dd650718b58ad6926e1e413 Mon Sep 17 00:00:00 2001 From: Harry Cordewener Date: Fri, 15 Nov 2024 17:38:58 -0500 Subject: [PATCH 1/4] Use ValueTask to go Faster. --- Core.Arango.Tests/FoxxTest.cs | 4 +-- Core.Arango.Tests/TransactionTest.cs | 2 +- Core.Arango/ArangoContext.cs | 4 +-- Core.Arango/IArangoContext.cs | 4 +-- Core.Arango/Linq/ArangoQueryExtensions.cs | 22 ++++++------ Core.Arango/Linq/Interface/IArangoLinq.cs | 2 +- Core.Arango/Linq/Internal/ArangoLinq.cs | 2 +- Core.Arango/Linq/Query/ArangoQueryable.cs | 10 +++--- Core.Arango/Modules/IArangoAnalyzerModule.cs | 4 +-- Core.Arango/Modules/IArangoBackupModule.cs | 4 +-- .../Modules/IArangoCollectionModule.cs | 6 ++-- Core.Arango/Modules/IArangoDatabaseModule.cs | 10 +++--- Core.Arango/Modules/IArangoDocumentModule.cs | 32 ++++++++--------- Core.Arango/Modules/IArangoFoxxModule.cs | 36 +++++++++---------- Core.Arango/Modules/IArangoFunctionModule.cs | 6 ++-- Core.Arango/Modules/IArangoGraphEdgeModule.cs | 18 +++++----- Core.Arango/Modules/IArangoGraphModule.cs | 4 +-- .../Modules/IArangoGraphVertexModule.cs | 18 +++++----- Core.Arango/Modules/IArangoIndexModule.cs | 2 +- Core.Arango/Modules/IArangoPregelModule.cs | 4 +-- Core.Arango/Modules/IArangoQueryModule.cs | 16 ++++----- .../Modules/IArangoTransactionModule.cs | 4 +-- Core.Arango/Modules/IArangoUserModule.cs | 12 +++---- Core.Arango/Modules/IArangoViewModule.cs | 4 +-- .../Modules/Internal/ArangoAnalyzerModule.cs | 4 +-- .../Modules/Internal/ArangoBackupModule.cs | 4 +-- .../Internal/ArangoCollectionModule.cs | 6 ++-- .../Modules/Internal/ArangoDatabaseModule.cs | 10 +++--- .../Modules/Internal/ArangoDocumentModule.cs | 32 ++++++++--------- .../Modules/Internal/ArangoFoxxModule.cs | 36 +++++++++---------- .../Modules/Internal/ArangoFunctionModule.cs | 6 ++-- .../Modules/Internal/ArangoGraphEdgeModule.cs | 18 +++++----- .../Modules/Internal/ArangoGraphModule.cs | 4 +-- .../Internal/ArangoGraphVertexModule.cs | 18 +++++----- .../Modules/Internal/ArangoIndexModule.cs | 2 +- Core.Arango/Modules/Internal/ArangoModule.cs | 4 +-- .../Modules/Internal/ArangoPregelModule.cs | 4 +-- .../Modules/Internal/ArangoQueryModule.cs | 16 ++++----- .../Internal/ArangoTransactionModule.cs | 4 +-- .../Modules/Internal/ArangoUserModule.cs | 12 +++---- .../Modules/Internal/ArangoViewModule.cs | 4 +-- Core.Arango/Transport/ArangoHttpTransport.cs | 6 ++-- Core.Arango/Transport/IArangoTransport.cs | 6 ++-- 43 files changed, 213 insertions(+), 213 deletions(-) diff --git a/Core.Arango.Tests/FoxxTest.cs b/Core.Arango.Tests/FoxxTest.cs index 3b8fd1c2f3..514efaf56e 100644 --- a/Core.Arango.Tests/FoxxTest.cs +++ b/Core.Arango.Tests/FoxxTest.cs @@ -38,7 +38,7 @@ await Arango.Foxx.InstallServiceAsync("test", "/sample/service", ArangoFoxxSourc Assert.Equal("/sample/service", services.First().Mount); } - private async Task BuildService(string response) + private async ValueTask BuildService(string response) { var ms = new MemoryStream(); using (var zip = new ZipArchive(ms, ZipArchiveMode.Create, true, Encoding.UTF8)) @@ -110,7 +110,7 @@ await Arango.Foxx.InstallServiceAsync("test", "/sample/service", await Arango.Foxx.ReplaceConfigurationAsync("test", "/sample/service", new { - currency = "€", + currency = "�", secretKey = "s3cr3t" }); diff --git a/Core.Arango.Tests/TransactionTest.cs b/Core.Arango.Tests/TransactionTest.cs index 470fd6fb32..f1523cf2b3 100644 --- a/Core.Arango.Tests/TransactionTest.cs +++ b/Core.Arango.Tests/TransactionTest.cs @@ -110,7 +110,7 @@ public async Task StreamTransactionQuery(string serializer) Assert.Equal(3, (await Arango.Query.FindAsync("test", "test", $"true")).Count); var exception = - await Assert.ThrowsAsync(() => Arango.Query.FindAsync(t2, "test", $"true")); + await Assert.ThrowsAsync(() => Arango.Query.FindAsync(t2, "test", $"true").AsTask()); Assert.NotNull(exception.ErrorNumber); Assert.NotNull(exception.Code); diff --git a/Core.Arango/ArangoContext.cs b/Core.Arango/ArangoContext.cs index 76d7a54b0c..78345428d9 100644 --- a/Core.Arango/ArangoContext.cs +++ b/Core.Arango/ArangoContext.cs @@ -110,7 +110,7 @@ public ArangoContext(string cs, IArangoConfiguration settings = null) public IArangoPregelModule Pregel { get; } /// - public async Task GetVersionAsync(CancellationToken cancellationToken = default) + public async ValueTask GetVersionAsync(CancellationToken cancellationToken = default) { var res = await Configuration.Transport.SendAsync(HttpMethod.Get, "/_db/_system/_api/version", @@ -123,7 +123,7 @@ public async Task GetVersionAsync(CancellationToken cancellationT } /// - public async Task> GetEndpointsAsync(CancellationToken cancellationToken = default) + public async ValueTask> GetEndpointsAsync(CancellationToken cancellationToken = default) { var res = await Configuration.Transport.SendAsync(HttpMethod.Get, "/_api/cluster/endpoints", cancellationToken: cancellationToken); diff --git a/Core.Arango/IArangoContext.cs b/Core.Arango/IArangoContext.cs index 9104fb1eba..6f79f91ef6 100644 --- a/Core.Arango/IArangoContext.cs +++ b/Core.Arango/IArangoContext.cs @@ -90,11 +90,11 @@ public interface IArangoContext /// /// Get Arango server version and license /// - Task GetVersionAsync(CancellationToken cancellationToken = default); + ValueTask GetVersionAsync(CancellationToken cancellationToken = default); /// /// Get Arango cluster endpoints /// - Task> GetEndpointsAsync(CancellationToken cancellationToken = default); + ValueTask> GetEndpointsAsync(CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Linq/ArangoQueryExtensions.cs b/Core.Arango/Linq/ArangoQueryExtensions.cs index 8a6f819955..f893417d11 100644 --- a/Core.Arango/Linq/ArangoQueryExtensions.cs +++ b/Core.Arango/Linq/ArangoQueryExtensions.cs @@ -51,29 +51,29 @@ public static (string aql, IDictionary bindVars) ToAql(this I return (data.Query.Trim(), data.BindVars); } - public static Task FirstAsync(this IQueryable source, CancellationToken cancellationToken = default) + public static ValueTask FirstAsync(this IQueryable source, CancellationToken cancellationToken = default) { return FirstOrDefaultAsync(source, false, null, cancellationToken); } - public static Task FirstAsync(this IQueryable source, + public static ValueTask FirstAsync(this IQueryable source, Expression> predicate, CancellationToken cancellationToken = default) { return FirstOrDefaultAsync(source, false, predicate, cancellationToken); } - public static Task FirstOrDefaultAsync(this IQueryable source, CancellationToken cancellationToken = default) + public static ValueTask FirstOrDefaultAsync(this IQueryable source, CancellationToken cancellationToken = default) { return FirstOrDefaultAsync(source, true, null, cancellationToken); } - public static Task FirstOrDefaultAsync(this IQueryable source, + public static ValueTask FirstOrDefaultAsync(this IQueryable source, Expression> predicate, CancellationToken cancellationToken = default) { return FirstOrDefaultAsync(source, true, predicate, cancellationToken); } - private static Task FirstOrDefaultAsync(this IQueryable source, bool returnDefaultWhenEmpty, + private static ValueTask FirstOrDefaultAsync(this IQueryable source, bool returnDefaultWhenEmpty, Expression> predicate, CancellationToken cancellationToken = default) { if (predicate != null) @@ -85,29 +85,29 @@ private static Task FirstOrDefaultAsync(this IQueryable source, bool re : source.AsArangoQueryable().FirstAsync(cancellationToken); } - public static Task SingleAsync(this IQueryable source, CancellationToken cancellationToken = default) + public static ValueTask SingleAsync(this IQueryable source, CancellationToken cancellationToken = default) { return SingleOrDefaultAsync(source, false, null, cancellationToken); } - public static Task SingleAsync(this IQueryable source, + public static ValueTask SingleAsync(this IQueryable source, Expression> predicate, CancellationToken cancellationToken = default) { return SingleOrDefaultAsync(source, false, predicate, cancellationToken); } - public static Task SingleOrDefaultAsync(this IQueryable source, CancellationToken cancellationToken = default) + public static ValueTask SingleOrDefaultAsync(this IQueryable source, CancellationToken cancellationToken = default) { return SingleOrDefaultAsync(source, true, null, cancellationToken); } - public static Task SingleOrDefaultAsync(this IQueryable source, + public static ValueTask SingleOrDefaultAsync(this IQueryable source, Expression> predicate, CancellationToken cancellationToken = default) { return SingleOrDefaultAsync(source, true, predicate, cancellationToken); } - private static Task SingleOrDefaultAsync(this IQueryable source, bool returnDefaultWhenEmpty, + private static ValueTask SingleOrDefaultAsync(this IQueryable source, bool returnDefaultWhenEmpty, Expression> predicate, CancellationToken cancellationToken = default) { if (predicate != null) @@ -119,7 +119,7 @@ private static Task SingleOrDefaultAsync(this IQueryable source, bool r : source.AsArangoQueryable().SingleAsync(cancellationToken); } - public static Task> ToListAsync(this IQueryable source, CancellationToken cancellationToken = default) + public static ValueTask> ToListAsync(this IQueryable source, CancellationToken cancellationToken = default) { return source.AsArangoQueryable().ToListAsync(cancellationToken); } diff --git a/Core.Arango/Linq/Interface/IArangoLinq.cs b/Core.Arango/Linq/Interface/IArangoLinq.cs index da627cf38f..a0cffa9f12 100644 --- a/Core.Arango/Linq/Interface/IArangoLinq.cs +++ b/Core.Arango/Linq/Interface/IArangoLinq.cs @@ -11,6 +11,6 @@ internal interface IArangoLinq public string ResolvePropertyName(Type t, string s); public string ResolveCollectionName(Type t); public IAsyncEnumerable StreamAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default); - public Task> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default); + public ValueTask> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Linq/Internal/ArangoLinq.cs b/Core.Arango/Linq/Internal/ArangoLinq.cs index 9c27340ba7..4e0855a3b8 100644 --- a/Core.Arango/Linq/Internal/ArangoLinq.cs +++ b/Core.Arango/Linq/Internal/ArangoLinq.cs @@ -34,7 +34,7 @@ public IAsyncEnumerable StreamAsync(string query, IDictionary(_handle, query, bindVars, cancellationToken: cancellationToken); } - public async Task> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default) + public async ValueTask> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default) { return await _context.Query.ExecuteAsync(_handle, query, bindVars, cancellationToken: cancellationToken).ConfigureAwait(false); } diff --git a/Core.Arango/Linq/Query/ArangoQueryable.cs b/Core.Arango/Linq/Query/ArangoQueryable.cs index acd9ac61ff..2171ef46a4 100644 --- a/Core.Arango/Linq/Query/ArangoQueryable.cs +++ b/Core.Arango/Linq/Query/ArangoQueryable.cs @@ -29,34 +29,34 @@ public ArangoQueryable(IQueryProvider provider, Expression expression, IArangoLi this.db = db; } - public async Task> ToListAsync(CancellationToken cancellationToken = default) + public async ValueTask> ToListAsync(CancellationToken cancellationToken = default) { var data = GetQueryData(); return await db.ExecuteAsync(data.Query, data.BindVars, cancellationToken).ConfigureAwait(false); } - public async Task SingleOrDefaultAsync(CancellationToken cancellationToken = default) + public async ValueTask SingleOrDefaultAsync(CancellationToken cancellationToken = default) { var data = GetQueryData(); var list = await db.ExecuteAsync(data.Query, data.BindVars, cancellationToken).ConfigureAwait(false); return list.SingleOrDefault(); } - public async Task SingleAsync(CancellationToken cancellationToken = default) + public async ValueTask SingleAsync(CancellationToken cancellationToken = default) { var data = GetQueryData(); var list = await db.ExecuteAsync(data.Query, data.BindVars, cancellationToken).ConfigureAwait(false); return list.Single(); } - public async Task FirstOrDefaultAsync(CancellationToken cancellationToken = default) + public async ValueTask FirstOrDefaultAsync(CancellationToken cancellationToken = default) { var data = GetQueryData(); var list = await db.ExecuteAsync(data.Query, data.BindVars, cancellationToken).ConfigureAwait(false); return list.FirstOrDefault(); } - public async Task FirstAsync(CancellationToken cancellationToken = default) + public async ValueTask FirstAsync(CancellationToken cancellationToken = default) { var data = GetQueryData(); var list = await db.ExecuteAsync(data.Query, data.BindVars, cancellationToken).ConfigureAwait(false); diff --git a/Core.Arango/Modules/IArangoAnalyzerModule.cs b/Core.Arango/Modules/IArangoAnalyzerModule.cs index 29d7249da0..20aa7de1dc 100644 --- a/Core.Arango/Modules/IArangoAnalyzerModule.cs +++ b/Core.Arango/Modules/IArangoAnalyzerModule.cs @@ -28,13 +28,13 @@ Task DeleteAsync(ArangoHandle database, string analyzer, bool force = false, /// /// returns a listing of available Analyzer definitions /// - Task> ListAsync(ArangoHandle database, + ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// /// returns an Analyzer definition /// - Task GetDefinitionAsync(ArangoHandle database, string analyzer, + ValueTask GetDefinitionAsync(ArangoHandle database, string analyzer, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoBackupModule.cs b/Core.Arango/Modules/IArangoBackupModule.cs index 6a96e20868..6edf1e0754 100644 --- a/Core.Arango/Modules/IArangoBackupModule.cs +++ b/Core.Arango/Modules/IArangoBackupModule.cs @@ -13,7 +13,7 @@ public interface IArangoBackupModule /// /// Creates a local backup. /// - Task CreateAsync(ArangoBackupRequest request, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoBackupRequest request, CancellationToken cancellationToken = default); /// /// Restores from a local backup. @@ -28,6 +28,6 @@ public interface IArangoBackupModule /// /// List all local backups. /// - Task> ListAsync(string id = null, CancellationToken cancellationToken = default); + ValueTask> ListAsync(string id = null, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoCollectionModule.cs b/Core.Arango/Modules/IArangoCollectionModule.cs index 9f33ae4423..3a7c6fac92 100644 --- a/Core.Arango/Modules/IArangoCollectionModule.cs +++ b/Core.Arango/Modules/IArangoCollectionModule.cs @@ -25,7 +25,7 @@ Task CreateAsync(ArangoHandle database, string collection, ArangoCollectionType /// /// Returns all collections /// - Task> ListAsync(ArangoHandle database, + ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// @@ -55,13 +55,13 @@ Task DropAsync(ArangoHandle database, string collection, /// /// Returns a collection /// - Task GetAsync(ArangoHandle database, string collection, + ValueTask GetAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); /// /// Checks of collection exists (calls ListAsync internally) /// - Task ExistAsync(ArangoHandle database, string collection, + ValueTask ExistAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); /// diff --git a/Core.Arango/Modules/IArangoDatabaseModule.cs b/Core.Arango/Modules/IArangoDatabaseModule.cs index 1f69a3de06..19615bdeb4 100644 --- a/Core.Arango/Modules/IArangoDatabaseModule.cs +++ b/Core.Arango/Modules/IArangoDatabaseModule.cs @@ -13,17 +13,17 @@ public interface IArangoDatabaseModule /// /// Creates a new database /// - Task CreateAsync(ArangoHandle name, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoHandle name, CancellationToken cancellationToken = default); /// /// Creates a new database with options /// - Task CreateAsync(ArangoDatabase database, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoDatabase database, CancellationToken cancellationToken = default); /// /// Retrieves information about the current database /// - Task GetAsync(ArangoHandle handle, CancellationToken cancellationToken = default); + ValueTask GetAsync(ArangoHandle handle, CancellationToken cancellationToken = default); /// /// Drop an existing database @@ -33,11 +33,11 @@ public interface IArangoDatabaseModule /// /// Checks if database exists /// - Task ExistAsync(ArangoHandle name, CancellationToken cancellationToken = default); + ValueTask ExistAsync(ArangoHandle name, CancellationToken cancellationToken = default); /// /// Retrieves a list of all existing databases /// - Task> ListAsync(CancellationToken cancellationToken = default); + ValueTask> ListAsync(CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoDocumentModule.cs b/Core.Arango/Modules/IArangoDocumentModule.cs index 142f2a955d..965d7be997 100644 --- a/Core.Arango/Modules/IArangoDocumentModule.cs +++ b/Core.Arango/Modules/IArangoDocumentModule.cs @@ -26,7 +26,7 @@ public interface IArangoDocumentModule /// HTTP 304 is returned. /// /// - Task GetAsync(ArangoHandle handle, + ValueTask GetAsync(ArangoHandle handle, string collection, string key, bool throwOnError = true, @@ -45,7 +45,7 @@ Task GetAsync(ArangoHandle handle, /// if it has the same revision value /// /// - Task> GetManyAsync(ArangoHandle handle, + ValueTask> GetManyAsync(ArangoHandle handle, string collection, IEnumerable keys, bool? ignoreRevs = null, @@ -54,7 +54,7 @@ Task> GetManyAsync(ArangoHandle handle, /// /// Creates multiple documents /// - Task>> CreateManyAsync(ArangoHandle database, + ValueTask>> CreateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, @@ -70,7 +70,7 @@ Task>> CreateManyAsync(ArangoHandle database, /// /// Creates multiple documents /// - Task>> CreateManyAsync(ArangoHandle database, + ValueTask>> CreateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, @@ -86,7 +86,7 @@ Task>> CreateManyAsync(ArangoHandle datab /// /// Create document /// - Task> CreateAsync(ArangoHandle database, + ValueTask> CreateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, @@ -101,7 +101,7 @@ Task> CreateAsync(ArangoHandle database, /// /// Create document /// - Task> CreateAsync(ArangoHandle database, + ValueTask> CreateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, @@ -116,14 +116,14 @@ Task> CreateAsync(ArangoHandle database, /// /// Removes multiple documents /// - Task>> DeleteManyAsync(ArangoHandle database, string collection, + ValueTask>> DeleteManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? returnOld = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); /// /// Removes single document by key /// - Task> DeleteAsync(ArangoHandle database, string collection, string key, + ValueTask> DeleteAsync(ArangoHandle database, string collection, string key, bool? waitForSync = null, bool? returnOld = null, bool? silent = null, bool? exclusive = null, string ifMatch = null, CancellationToken cancellationToken = default); @@ -143,7 +143,7 @@ Task ImportAsync(ArangoHandle database, string collection, IEnumerable doc /// /// Replaces multiple documents /// - Task>> ReplaceManyAsync(ArangoHandle database, string collection, + ValueTask>> ReplaceManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? returnOld = null, bool? returnNew = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); @@ -151,7 +151,7 @@ Task>> ReplaceManyAsync(ArangoHandle database /// /// Replaces multiple documents /// - Task>> ReplaceManyAsync(ArangoHandle database, string collection, + ValueTask>> ReplaceManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? returnOld = null, bool? returnNew = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); @@ -159,21 +159,21 @@ Task>> ReplaceManyAsync(ArangoHandle data /// /// Replace single document /// - Task> ReplaceAsync(ArangoHandle database, string collection, T doc, + ValueTask> ReplaceAsync(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool? returnOld = null, bool? returnNew = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); /// /// Replace single document /// - Task> ReplaceAsync(ArangoHandle database, string collection, T doc, + ValueTask> ReplaceAsync(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool? returnOld = null, bool? returnNew = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); /// /// Updates multiple documents /// - Task>> UpdateManyAsync(ArangoHandle database, string collection, + ValueTask>> UpdateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); @@ -181,7 +181,7 @@ Task>> UpdateManyAsync(ArangoHandle datab /// /// Updates multiple documents /// - Task>> UpdateManyAsync(ArangoHandle database, string collection, + ValueTask>> UpdateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); @@ -189,7 +189,7 @@ Task>> UpdateManyAsync(ArangoHandle database, /// /// Updates single document /// - Task> UpdateAsync(ArangoHandle database, string collection, T doc, + ValueTask> UpdateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); @@ -197,7 +197,7 @@ Task> UpdateAsync(ArangoHandle database, strin /// /// Updates single document /// - Task> UpdateAsync(ArangoHandle database, string collection, T doc, + ValueTask> UpdateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? ignoreRevs = null, bool? exclusive = null, CancellationToken cancellationToken = default); diff --git a/Core.Arango/Modules/IArangoFoxxModule.cs b/Core.Arango/Modules/IArangoFoxxModule.cs index 50578cc02b..e343218efc 100644 --- a/Core.Arango/Modules/IArangoFoxxModule.cs +++ b/Core.Arango/Modules/IArangoFoxxModule.cs @@ -18,7 +18,7 @@ public interface IArangoFoxxModule /// Whether or not system services should be excluded from the result. /// /// - Task> ListServicesAsync(ArangoHandle database, bool? excludeSystem = null, + ValueTask> ListServicesAsync(ArangoHandle database, bool? excludeSystem = null, CancellationToken cancellationToken = default); /// @@ -32,7 +32,7 @@ Task> ListServicesAsync(ArangoHandle database, bo /// Set to true to install the service in 2.8 legacy compatibility mode. /// /// - Task InstallServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, + ValueTask InstallServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, bool? development = null, bool? setup = null, bool? legacy = null, CancellationToken cancellationToken = default); @@ -48,7 +48,7 @@ Task InstallServiceAsync(ArangoHandle database, string mount, Arango /// Set to true to force service install even if no service is installed under given mount. /// /// - Task ReplaceServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, + ValueTask ReplaceServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, bool? teardown = null, bool? setup = null, bool? legacy = null, bool? force = null, CancellationToken cancellationToken = default); @@ -64,89 +64,89 @@ Task ReplaceServiceAsync(ArangoHandle database, string mount, Arango /// Set to true to force service install even if no service is installed under given mount. /// /// - Task UpgradeServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, + ValueTask UpgradeServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, bool? teardown = null, bool? setup = null, bool? legacy = null, bool? force = null, CancellationToken cancellationToken = default); /// /// Uninstall service /// - Task UninstallServiceAsync(ArangoHandle database, string mount, + ValueTask UninstallServiceAsync(ArangoHandle database, string mount, bool? teardown = null, CancellationToken cancellationToken = default); /// /// Get configuration options /// - Task GetConfigurationAsync(ArangoHandle database, string mount, + ValueTask GetConfigurationAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default); /// /// Update configuration options /// - Task UpdateConfigurationAsync(ArangoHandle database, string mount, + ValueTask UpdateConfigurationAsync(ArangoHandle database, string mount, object configuration = null, CancellationToken cancellationToken = default); /// /// Replace configuration options /// - Task ReplaceConfigurationAsync(ArangoHandle database, string mount, + ValueTask ReplaceConfigurationAsync(ArangoHandle database, string mount, object configuration = null, CancellationToken cancellationToken = default); /// /// Get dependency options /// - Task GetDependenciesAsync(ArangoHandle database, string mount, + ValueTask GetDependenciesAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default); /// /// Update dependency options /// - Task UpdateDependenciesAsync(ArangoHandle database, string mount, + ValueTask UpdateDependenciesAsync(ArangoHandle database, string mount, object dependencies = null, CancellationToken cancellationToken = default); /// /// Replace dependency options /// - Task ReplaceDependenciesAsync(ArangoHandle database, string mount, + ValueTask ReplaceDependenciesAsync(ArangoHandle database, string mount, object dependencies = null, CancellationToken cancellationToken = default); /// /// HTTP GET request to Foxx service /// - Task GetAsync(ArangoHandle database, string path, + ValueTask GetAsync(ArangoHandle database, string path, IDictionary queryParams = null, CancellationToken cancellationToken = default); /// /// HTTP POST request to Foxx service /// - Task PostAsync(ArangoHandle database, string path, object body, + ValueTask PostAsync(ArangoHandle database, string path, object body, IDictionary queryParams = null, CancellationToken cancellationToken = default); /// /// HTTP PUT request to Foxx service /// - Task PutAsync(ArangoHandle database, string path, object body, + ValueTask PutAsync(ArangoHandle database, string path, object body, IDictionary queryParams = null, CancellationToken cancellationToken = default); /// /// HTTP PATCH request to Foxx service /// - Task PatchAsync(ArangoHandle database, string path, object body, + ValueTask PatchAsync(ArangoHandle database, string path, object body, IDictionary queryParams = null, CancellationToken cancellationToken = default); /// /// HTTP DELETE request to Foxx service /// - Task DeleteAsync(ArangoHandle database, string path, + ValueTask DeleteAsync(ArangoHandle database, string path, IDictionary queryParams = null, CancellationToken cancellationToken = default); @@ -177,7 +177,7 @@ Task DisableDevelopmentModeAsync(ArangoHandle database, string mount, /// /// /// - Task DownloadServiceAsync(ArangoHandle database, string mount, + ValueTask DownloadServiceAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default); /// @@ -189,7 +189,7 @@ Task DownloadServiceAsync(ArangoHandle database, string mount, /// /// /// - Task RunServiceScriptAsync(ArangoHandle database, string mount, string name, + ValueTask RunServiceScriptAsync(ArangoHandle database, string mount, string name, object body = null, CancellationToken cancellationToken = default); } diff --git a/Core.Arango/Modules/IArangoFunctionModule.cs b/Core.Arango/Modules/IArangoFunctionModule.cs index a3a0e3c055..d89c3bc170 100644 --- a/Core.Arango/Modules/IArangoFunctionModule.cs +++ b/Core.Arango/Modules/IArangoFunctionModule.cs @@ -14,7 +14,7 @@ public interface IArangoFunctionModule /// create a new AQL user function /// /// true if newly created - Task CreateAsync(ArangoHandle database, ArangoFunctionDefinition request, + ValueTask CreateAsync(ArangoHandle database, ArangoFunctionDefinition request, CancellationToken cancellationToken = default); /// @@ -28,7 +28,7 @@ Task CreateAsync(ArangoHandle database, ArangoFunctionDefinition request, /// /// /// number of deleted functions - Task RemoveAsync(ArangoHandle database, string name, bool? group = false, + ValueTask RemoveAsync(ArangoHandle database, string name, bool? group = false, CancellationToken cancellationToken = default); /// @@ -38,7 +38,7 @@ Task RemoveAsync(ArangoHandle database, string name, bool? group = false, /// filter user functions from namespace /// /// list of function definitions - Task> ListAsync(ArangoHandle database, string ns = null, + ValueTask> ListAsync(ArangoHandle database, string ns = null, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoGraphEdgeModule.cs b/Core.Arango/Modules/IArangoGraphEdgeModule.cs index aa7386d005..a95ad42975 100644 --- a/Core.Arango/Modules/IArangoGraphEdgeModule.cs +++ b/Core.Arango/Modules/IArangoGraphEdgeModule.cs @@ -12,13 +12,13 @@ public interface IArangoGraphEdgeModule /// /// Fetch an edge /// - Task GetAsync(ArangoHandle database, string graph, string collection, string key, + ValueTask GetAsync(ArangoHandle database, string graph, string collection, string key, CancellationToken cancellationToken = default); /// /// Creates an edge in an existing graph /// - Task> CreateAsync(ArangoHandle database, string graph, string collection, + ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default); @@ -26,7 +26,7 @@ Task> CreateAsync(ArangoHandle database, strin /// /// Modify an existing edge /// - Task> UpdateAsync(ArangoHandle database, string graph, string collection, + ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -34,7 +34,7 @@ Task> UpdateAsync(ArangoHandle database, strin /// /// Replace the content of an existing edge /// - Task> ReplaceAsync(ArangoHandle database, string graph, string collection, + ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -42,7 +42,7 @@ Task> ReplaceAsync(ArangoHandle database, stri /// /// Removes an edge from graph /// - Task> RemoveAsync(ArangoHandle database, string graph, string collection, + ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -50,14 +50,14 @@ Task> RemoveAsync(ArangoHandle database, strin /// /// Creates an edge in an existing graph /// - Task> CreateAsync(ArangoHandle database, string graph, string collection, T doc, + ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default); /// /// Modify an existing edge /// - Task> UpdateAsync(ArangoHandle database, string graph, string collection, + ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -65,7 +65,7 @@ Task> UpdateAsync(ArangoHandle database, string gr /// /// Replace the content of an existing edge /// - Task> ReplaceAsync(ArangoHandle database, string graph, string collection, + ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -73,7 +73,7 @@ Task> ReplaceAsync(ArangoHandle database, string g /// /// Removes an edge from graph /// - Task> RemoveAsync(ArangoHandle database, string graph, string collection, + ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default); diff --git a/Core.Arango/Modules/IArangoGraphModule.cs b/Core.Arango/Modules/IArangoGraphModule.cs index bd3c275c74..7b579ed4cd 100644 --- a/Core.Arango/Modules/IArangoGraphModule.cs +++ b/Core.Arango/Modules/IArangoGraphModule.cs @@ -33,13 +33,13 @@ public interface IArangoGraphModule /// /// Lists all graphs known to the graph module. /// - Task> ListAsync(ArangoHandle database, + ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// /// Get a graph from the graph module. /// - Task GetAsync(ArangoHandle database, string graph, CancellationToken cancellationToken = default); + ValueTask GetAsync(ArangoHandle database, string graph, CancellationToken cancellationToken = default); /// /// Add an additional vertex collection to the graph. diff --git a/Core.Arango/Modules/IArangoGraphVertexModule.cs b/Core.Arango/Modules/IArangoGraphVertexModule.cs index 9eb7f00f45..709bebe691 100644 --- a/Core.Arango/Modules/IArangoGraphVertexModule.cs +++ b/Core.Arango/Modules/IArangoGraphVertexModule.cs @@ -12,13 +12,13 @@ public interface IArangoGraphVertexModule /// /// fetches an existing vertex /// - Task GetAsync(ArangoHandle database, string graph, string collection, string key, + ValueTask GetAsync(ArangoHandle database, string graph, string collection, string key, CancellationToken cancellationToken = default); /// /// Create a new vertex /// - Task> CreateAsync(ArangoHandle database, string graph, string collection, + ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default); @@ -26,14 +26,14 @@ Task> CreateAsync(ArangoHandle database, str /// /// Create a new vertex /// - Task> CreateAsync(ArangoHandle database, string graph, string collection, T doc, + ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default); /// /// Update an existing vertex /// - Task> UpdateAsync(ArangoHandle database, string graph, string collection, + ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -41,7 +41,7 @@ Task> UpdateAsync(ArangoHandle database, str /// /// Update an existing vertex /// - Task> UpdateAsync(ArangoHandle database, string graph, string collection, + ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -49,7 +49,7 @@ Task> UpdateAsync(ArangoHandle database, string /// /// Replaces an existing vertex /// - Task> ReplaceAsync(ArangoHandle database, string graph, string collection, + ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -57,7 +57,7 @@ Task> ReplaceAsync(ArangoHandle database, st /// /// Replaces an existing vertex /// - Task> ReplaceAsync(ArangoHandle database, string graph, string collection, + ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -65,7 +65,7 @@ Task> ReplaceAsync(ArangoHandle database, string /// /// Removes a vertex from a graph /// - Task> RemoveAsync(ArangoHandle database, string graph, string collection, + ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default); @@ -73,7 +73,7 @@ Task> RemoveAsync(ArangoHandle database, string /// /// Removes a vertex from a graph /// - Task> RemoveAsync(ArangoHandle database, string graph, string collection, + ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default); diff --git a/Core.Arango/Modules/IArangoIndexModule.cs b/Core.Arango/Modules/IArangoIndexModule.cs index 896af87858..0452d0ef77 100644 --- a/Core.Arango/Modules/IArangoIndexModule.cs +++ b/Core.Arango/Modules/IArangoIndexModule.cs @@ -29,7 +29,7 @@ Task CreateAsync(ArangoHandle database, string collection, ArangoIndex request, /// /// Returns all indexes of a collection /// - Task> ListAsync(ArangoHandle database, string collection, + ValueTask> ListAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoPregelModule.cs b/Core.Arango/Modules/IArangoPregelModule.cs index 9998f31a83..907173ea7a 100644 --- a/Core.Arango/Modules/IArangoPregelModule.cs +++ b/Core.Arango/Modules/IArangoPregelModule.cs @@ -12,13 +12,13 @@ public interface IArangoPregelModule /// /// Start the execution of a Pregel algorithm /// - Task StartJobAsync(ArangoHandle database, ArangoPregel job, + ValueTask StartJobAsync(ArangoHandle database, ArangoPregel job, CancellationToken cancellationToken = default); /// /// Get the status of a Pregel execution /// - Task GetJobStatusAsync(ArangoHandle database, string id, + ValueTask GetJobStatusAsync(ArangoHandle database, string id, CancellationToken cancellationToken = default); /// diff --git a/Core.Arango/Modules/IArangoQueryModule.cs b/Core.Arango/Modules/IArangoQueryModule.cs index f059f9d510..64f4211f5e 100644 --- a/Core.Arango/Modules/IArangoQueryModule.cs +++ b/Core.Arango/Modules/IArangoQueryModule.cs @@ -21,7 +21,7 @@ public interface IArangoQueryModule /// RETURN expression /// /// - Task> FindAsync(ArangoHandle database, string collection, FormattableString filter, + ValueTask> FindAsync(ArangoHandle database, string collection, FormattableString filter, string projection = null, int limit = 1000, CancellationToken cancellationToken = default); /// @@ -33,26 +33,26 @@ Task> FindAsync(ArangoHandle database, string collection, Formattable /// FILTER expression with "x." /// RETURN expression /// - Task SingleOrDefaultAsync(ArangoHandle database, string collection, FormattableString filter, + ValueTask SingleOrDefaultAsync(ArangoHandle database, string collection, FormattableString filter, string projection = null, CancellationToken cancellationToken = default); /// /// Execute query (Linq provider) /// - Task ExecuteAsync(Type type, bool isEnumerable, ArangoHandle database, string query, + ValueTask ExecuteAsync(Type type, bool isEnumerable, ArangoHandle database, string query, IDictionary bindVars, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default); /// /// Execute query with string interpolated bind parameters /// - Task> ExecuteAsync(ArangoHandle database, FormattableString query, bool? cache = null, + ValueTask> ExecuteAsync(ArangoHandle database, FormattableString query, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default); /// /// Execute query with bind parameters in dictionary /// - Task> ExecuteAsync(ArangoHandle database, string query, IDictionary bindVars, + ValueTask> ExecuteAsync(ArangoHandle database, string query, IDictionary bindVars, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default); /// @@ -82,7 +82,7 @@ IAsyncEnumerable ExecuteStreamAsync(ArangoHandle database, ArangoCursor cu /// /// explain an AQL query and return information about it /// - Task ExplainAsync(ArangoHandle database, string query, + ValueTask ExplainAsync(ArangoHandle database, string query, IDictionary bindVars, bool allPlans = false, CancellationToken cancellationToken = default); @@ -90,14 +90,14 @@ Task ExplainAsync(ArangoHandle database, string query, /// /// explain an AQL query and return information about it /// - Task ExplainAsync(ArangoHandle database, FormattableString query, + ValueTask ExplainAsync(ArangoHandle database, FormattableString query, bool allPlans = false, CancellationToken cancellationToken = default); /// /// parse an AQL query and return information about it /// - Task ParseAsync(ArangoHandle database, string query, + ValueTask ParseAsync(ArangoHandle database, string query, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoTransactionModule.cs b/Core.Arango/Modules/IArangoTransactionModule.cs index 2b50770fce..ca5b47560c 100644 --- a/Core.Arango/Modules/IArangoTransactionModule.cs +++ b/Core.Arango/Modules/IArangoTransactionModule.cs @@ -12,7 +12,7 @@ public interface IArangoTransactionModule /// /// Begin a server-side transaction /// - Task BeginAsync(ArangoHandle database, ArangoTransaction request, + ValueTask BeginAsync(ArangoHandle database, ArangoTransaction request, CancellationToken cancellationToken = default); /// @@ -28,7 +28,7 @@ Task BeginAsync(ArangoHandle database, ArangoTransaction request, /// /// execute a server-side (script) transaction /// - Task ExecuteAsync(ArangoHandle database, ArangoTransaction request, + ValueTask ExecuteAsync(ArangoHandle database, ArangoTransaction request, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoUserModule.cs b/Core.Arango/Modules/IArangoUserModule.cs index aabf79205f..25155685fa 100644 --- a/Core.Arango/Modules/IArangoUserModule.cs +++ b/Core.Arango/Modules/IArangoUserModule.cs @@ -13,34 +13,34 @@ public interface IArangoUserModule /// /// Create a new user. /// - Task CreateAsync(ArangoUser user, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoUser user, CancellationToken cancellationToken = default); /// /// Delete a user permanently. /// - Task DeleteAsync(string user, CancellationToken cancellationToken = default); + ValueTask DeleteAsync(string user, CancellationToken cancellationToken = default); /// /// Clear the database access level, revert back to the default access level /// - Task DeleteDatabaseAccessAsync(ArangoHandle handle, string user, + ValueTask DeleteDatabaseAccessAsync(ArangoHandle handle, string user, CancellationToken cancellationToken = default); /// /// Lists all users /// - Task> ListAsync(CancellationToken cancellationToken = default); + ValueTask> ListAsync(CancellationToken cancellationToken = default); /// /// Modify attributes of an existing user /// - Task PatchAsync(ArangoUser user, CancellationToken cancellationToken = default); + ValueTask PatchAsync(ArangoUser user, CancellationToken cancellationToken = default); /// /// Set the database access level. /// - Task SetDatabaseAccessAsync(ArangoHandle handle, string user, ArangoAccess access, + ValueTask SetDatabaseAccessAsync(ArangoHandle handle, string user, ArangoAccess access, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoViewModule.cs b/Core.Arango/Modules/IArangoViewModule.cs index 81527d61e7..fb1453fe76 100644 --- a/Core.Arango/Modules/IArangoViewModule.cs +++ b/Core.Arango/Modules/IArangoViewModule.cs @@ -40,7 +40,7 @@ public interface IArangoViewModule /// /// Returns all Views /// - Task> ListAsync(ArangoHandle database, + ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// @@ -50,7 +50,7 @@ Task> ListAsync(ArangoHandle database /// /// /// - Task GetPropertiesAsync(ArangoHandle database, string view, + ValueTask GetPropertiesAsync(ArangoHandle database, string view, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs b/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs index d7c522c930..4514fe2f6e 100644 --- a/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs +++ b/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs @@ -13,7 +13,7 @@ internal ArangoAnalyzerModule(IArangoContext context) : base(context) { } - public async Task> ListAsync(ArangoHandle database, + public async ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default) { return (await SendAsync>(database, HttpMethod.Get, @@ -21,7 +21,7 @@ public async Task> ListAsync(ArangoHandle da cancellationToken: cancellationToken)).Result; } - public async Task GetDefinitionAsync(ArangoHandle database, string analyzer, + public async ValueTask GetDefinitionAsync(ArangoHandle database, string analyzer, CancellationToken cancellationToken = default) { return await SendAsync(database, HttpMethod.Get, diff --git a/Core.Arango/Modules/Internal/ArangoBackupModule.cs b/Core.Arango/Modules/Internal/ArangoBackupModule.cs index fb38690d44..3db2539410 100644 --- a/Core.Arango/Modules/Internal/ArangoBackupModule.cs +++ b/Core.Arango/Modules/Internal/ArangoBackupModule.cs @@ -14,7 +14,7 @@ internal ArangoBackupModule(IArangoContext context) : base(context) { } - public async Task CreateAsync(ArangoBackupRequest request, + public async ValueTask CreateAsync(ArangoBackupRequest request, CancellationToken cancellationToken = default) { var res = await SendAsync>(null, HttpMethod.Post, "/_admin/backup/create", @@ -41,7 +41,7 @@ await SendAsync(null, HttpMethod.Post, "/_admin/backup/delete", }, cancellationToken: cancellationToken); } - public async Task> ListAsync(string id = null, CancellationToken cancellationToken = default) + public async ValueTask> ListAsync(string id = null, CancellationToken cancellationToken = default) { object req = null; diff --git a/Core.Arango/Modules/Internal/ArangoCollectionModule.cs b/Core.Arango/Modules/Internal/ArangoCollectionModule.cs index 0841fd8830..3ac3d4e9d9 100644 --- a/Core.Arango/Modules/Internal/ArangoCollectionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoCollectionModule.cs @@ -43,7 +43,7 @@ await SendAsync(database, HttpMethod.Put, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task> ListAsync(ArangoHandle database, + public async ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default) { var res = await SendAsync>(database, HttpMethod.Get, @@ -73,7 +73,7 @@ await SendAsync(database, HttpMethod.Put, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task ExistAsync(ArangoHandle database, string collection, + public async ValueTask ExistAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { var collections = await ListAsync(database, cancellationToken).ConfigureAwait(false); @@ -99,7 +99,7 @@ await SendAsync( null, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task GetAsync(ArangoHandle database, string collection, + public async ValueTask GetAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { return await SendAsync( diff --git a/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs b/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs index ec4782c8c8..8199752ea7 100644 --- a/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs +++ b/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs @@ -14,7 +14,7 @@ internal ArangoDatabaseModule(IArangoContext context) : base(context) { } - public async Task CreateAsync(ArangoHandle name, CancellationToken cancellationToken = default) + public async ValueTask CreateAsync(ArangoHandle name, CancellationToken cancellationToken = default) { var res = await SendAsync(null, HttpMethod.Post, ApiPath("_system", "database"), @@ -26,7 +26,7 @@ public async Task CreateAsync(ArangoHandle name, CancellationToken cancell return res != null; } - public async Task CreateAsync(ArangoDatabase database, CancellationToken cancellationToken = default) + public async ValueTask CreateAsync(ArangoDatabase database, CancellationToken cancellationToken = default) { database.Name = RealmPrefix(database.Name); @@ -37,7 +37,7 @@ public async Task CreateAsync(ArangoDatabase database, CancellationToken c return res != null; } - public async Task GetAsync(ArangoHandle handle, + public async ValueTask GetAsync(ArangoHandle handle, CancellationToken cancellationToken = default) { var res = await SendAsync>(null, HttpMethod.Get, @@ -47,7 +47,7 @@ public async Task GetAsync(ArangoHandle handle, return res?.Result; } - public async Task> ListAsync(CancellationToken cancellationToken = default) + public async ValueTask> ListAsync(CancellationToken cancellationToken = default) { var res = await SendAsync>(null, HttpMethod.Get, ApiPath("_system", "database"), cancellationToken: cancellationToken); @@ -62,7 +62,7 @@ public async Task> ListAsync(CancellationToken cancellationToken = .ToList(); } - public async Task ExistAsync(ArangoHandle handle, CancellationToken cancellationToken = default) + public async ValueTask ExistAsync(ArangoHandle handle, CancellationToken cancellationToken = default) { var db = await GetAsync(handle, cancellationToken); return db != null; diff --git a/Core.Arango/Modules/Internal/ArangoDocumentModule.cs b/Core.Arango/Modules/Internal/ArangoDocumentModule.cs index f1970b6858..34a0a9bc4a 100644 --- a/Core.Arango/Modules/Internal/ArangoDocumentModule.cs +++ b/Core.Arango/Modules/Internal/ArangoDocumentModule.cs @@ -15,7 +15,7 @@ internal ArangoDocumentModule(IArangoContext context) : base(context) { } - public async Task GetAsync(ArangoHandle database, string collection, string key, + public async ValueTask GetAsync(ArangoHandle database, string collection, string key, bool throwOnError = true, string ifMatch = null, string ifNoneMatch = null, @@ -33,7 +33,7 @@ public async Task GetAsync(ArangoHandle database, string collection, strin null, throwOnError, headers: headers, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task> GetManyAsync(ArangoHandle database, string collection, IEnumerable docs, + public async ValueTask> GetManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? ignoreRevs = null, CancellationToken cancellationToken = default) { @@ -48,7 +48,7 @@ public async Task> GetManyAsync(ArangoHandle database, string collect cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task>> CreateManyAsync(ArangoHandle database, + public async ValueTask>> CreateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? exclusive = null, ArangoOverwriteMode? overwriteMode = null, @@ -86,7 +86,7 @@ public async Task>> CreateManyAsync(ArangoHan docs, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task>> CreateManyAsync(ArangoHandle database, + public async ValueTask>> CreateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? exclusive = null, ArangoOverwriteMode? overwriteMode = null, @@ -97,7 +97,7 @@ public async Task>> CreateManyAsync(Arang returnOld, returnNew, silent, exclusive, overwriteMode, cancellationToken).ConfigureAwait(false); } - public async Task> CreateAsync(ArangoHandle database, string collection, T doc, + public async ValueTask> CreateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, bool? exclusive = null, ArangoOverwriteMode? overwriteMode = null, @@ -110,7 +110,7 @@ public async Task> CreateAsync(ArangoHandle databa return res?.SingleOrDefault(); } - public async Task> CreateAsync(ArangoHandle database, string collection, + public async ValueTask> CreateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, @@ -140,7 +140,7 @@ await SendAsync(database, HttpMethod.Post, query, cancellationToken: cancellationToken); } - public async Task> DeleteAsync(ArangoHandle database, string collection, + public async ValueTask> DeleteAsync(ArangoHandle database, string collection, string key, bool? waitForSync = null, bool? returnOld = null, @@ -176,7 +176,7 @@ public async Task> DeleteAsync(ArangoHandle database, cancellationToken: cancellationToken); } - public async Task>> DeleteManyAsync(ArangoHandle database, + public async ValueTask>> DeleteManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? returnOld = null, @@ -206,7 +206,7 @@ public async Task>> DeleteManyAsync(ArangoHan cancellationToken: cancellationToken); } - public async Task>> UpdateManyAsync(ArangoHandle database, + public async ValueTask>> UpdateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? keepNull = null, @@ -223,7 +223,7 @@ public async Task>> UpdateManyAsync(Arang returnOld, returnNew, silent, ignoreRevs, exclusive, cancellationToken).ConfigureAwait(false); } - public async Task>> UpdateManyAsync(ArangoHandle database, + public async ValueTask>> UpdateManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? keepNull = null, @@ -268,7 +268,7 @@ public async Task>> UpdateManyAsync(ArangoHan docs, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task> UpdateAsync(ArangoHandle database, string collection, + public async ValueTask> UpdateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, @@ -287,7 +287,7 @@ public async Task> UpdateAsync(ArangoHandle da return res.SingleOrDefault(); } - public async Task> UpdateAsync(ArangoHandle database, string collection, + public async ValueTask> UpdateAsync(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, @@ -306,7 +306,7 @@ public async Task> UpdateAsync(ArangoHandle databa return res?.SingleOrDefault(); } - public async Task>> ReplaceManyAsync(ArangoHandle database, + public async ValueTask>> ReplaceManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? returnOld = null, @@ -339,7 +339,7 @@ public async Task>> ReplaceManyAsync(ArangoHa docs, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task>> ReplaceManyAsync(ArangoHandle database, + public async ValueTask>> ReplaceManyAsync(ArangoHandle database, string collection, IEnumerable docs, bool? waitForSync = null, bool? returnOld = null, @@ -352,7 +352,7 @@ public async Task>> ReplaceManyAsync(Aran waitForSync, returnOld, returnNew, ignoreRevs, exclusive, cancellationToken).ConfigureAwait(false); } - public async Task> ReplaceAsync(ArangoHandle database, string collection, + public async ValueTask> ReplaceAsync(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool? returnOld = null, @@ -367,7 +367,7 @@ public async Task> ReplaceAsync(ArangoHandle datab return res?.SingleOrDefault(); } - public async Task> ReplaceAsync(ArangoHandle database, string collection, + public async ValueTask> ReplaceAsync(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool? returnOld = null, diff --git a/Core.Arango/Modules/Internal/ArangoFoxxModule.cs b/Core.Arango/Modules/Internal/ArangoFoxxModule.cs index 98eb2af3c8..2c2e794a61 100644 --- a/Core.Arango/Modules/Internal/ArangoFoxxModule.cs +++ b/Core.Arango/Modules/Internal/ArangoFoxxModule.cs @@ -15,7 +15,7 @@ internal ArangoFoxxModule(IArangoContext context) : base(context) { } - public async Task> ListServicesAsync(ArangoHandle database, + public async ValueTask> ListServicesAsync(ArangoHandle database, bool? excludeSystem = null, CancellationToken cancellationToken = default) { @@ -29,7 +29,7 @@ public async Task> ListServicesAsync(ArangoHandle cancellationToken: cancellationToken); } - public async Task InstallServiceAsync(ArangoHandle database, + public async ValueTask InstallServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, bool? development = null, bool? setup = null, bool? legacy = null, CancellationToken cancellationToken = default) @@ -52,7 +52,7 @@ public async Task InstallServiceAsync(ArangoHandle database, return new ArangoVoid(); } - public async Task ReplaceServiceAsync(ArangoHandle database, + public async ValueTask ReplaceServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, bool? teardown = null, bool? setup = null, bool? legacy = null, bool? force = null, CancellationToken cancellationToken = default) @@ -78,7 +78,7 @@ public async Task ReplaceServiceAsync(ArangoHandle database, return new ArangoVoid(); } - public async Task UpgradeServiceAsync(ArangoHandle database, + public async ValueTask UpgradeServiceAsync(ArangoHandle database, string mount, ArangoFoxxSource service, bool? teardown = null, bool? setup = null, bool? legacy = null, bool? force = null, CancellationToken cancellationToken = default) @@ -104,7 +104,7 @@ public async Task UpgradeServiceAsync(ArangoHandle database, return new ArangoVoid(); } - public async Task UninstallServiceAsync(ArangoHandle database, string mount, + public async ValueTask UninstallServiceAsync(ArangoHandle database, string mount, bool? teardown = null, CancellationToken cancellationToken = default) { @@ -118,7 +118,7 @@ public async Task UninstallServiceAsync(ArangoHandle database, strin cancellationToken: cancellationToken); } - public async Task GetConfigurationAsync(ArangoHandle database, string mount, + public async ValueTask GetConfigurationAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default) { var parameter = new Dictionary { { "mount", mount } }; @@ -128,7 +128,7 @@ public async Task GetConfigurationAsync(ArangoHandle database, string moun cancellationToken: cancellationToken); } - public async Task UpdateConfigurationAsync(ArangoHandle database, string mount, + public async ValueTask UpdateConfigurationAsync(ArangoHandle database, string mount, object configuration, CancellationToken cancellationToken = default) { @@ -139,7 +139,7 @@ public async Task UpdateConfigurationAsync(ArangoHandle database, st cancellationToken: cancellationToken); } - public async Task ReplaceConfigurationAsync(ArangoHandle database, string mount, + public async ValueTask ReplaceConfigurationAsync(ArangoHandle database, string mount, object configuration, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public async Task ReplaceConfigurationAsync(ArangoHandle database, s cancellationToken: cancellationToken); } - public async Task GetDependenciesAsync(ArangoHandle database, string mount, + public async ValueTask GetDependenciesAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default) { var parameter = new Dictionary { { "mount", mount } }; @@ -160,7 +160,7 @@ public async Task GetDependenciesAsync(ArangoHandle database, string mount cancellationToken: cancellationToken); } - public async Task UpdateDependenciesAsync(ArangoHandle database, string mount, + public async ValueTask UpdateDependenciesAsync(ArangoHandle database, string mount, object dependencies, CancellationToken cancellationToken = default) { @@ -171,7 +171,7 @@ public async Task UpdateDependenciesAsync(ArangoHandle database, str cancellationToken: cancellationToken); } - public async Task ReplaceDependenciesAsync(ArangoHandle database, string mount, + public async ValueTask ReplaceDependenciesAsync(ArangoHandle database, string mount, object dependencies, CancellationToken cancellationToken = default) { @@ -202,7 +202,7 @@ await SendAsync(database, HttpMethod.Delete, cancellationToken: cancellationToken); } - public async Task GetAsync(ArangoHandle database, string mount, + public async ValueTask GetAsync(ArangoHandle database, string mount, IDictionary queryParams = null, CancellationToken cancellationToken = default) { @@ -211,7 +211,7 @@ public async Task GetAsync(ArangoHandle database, string mount, cancellationToken: cancellationToken); } - public async Task PostAsync(ArangoHandle database, string mount, object body, + public async ValueTask PostAsync(ArangoHandle database, string mount, object body, IDictionary queryParams = null, CancellationToken cancellationToken = default) { @@ -220,7 +220,7 @@ public async Task PostAsync(ArangoHandle database, string mount, object bo cancellationToken: cancellationToken); } - public async Task PutAsync(ArangoHandle database, string mount, object body, + public async ValueTask PutAsync(ArangoHandle database, string mount, object body, IDictionary queryParams = null, CancellationToken cancellationToken = default) { @@ -229,7 +229,7 @@ public async Task PutAsync(ArangoHandle database, string mount, object bod cancellationToken: cancellationToken); } - public async Task PatchAsync(ArangoHandle database, string mount, object body, + public async ValueTask PatchAsync(ArangoHandle database, string mount, object body, IDictionary queryParams = null, CancellationToken cancellationToken = default) { @@ -238,7 +238,7 @@ public async Task PatchAsync(ArangoHandle database, string mount, object b cancellationToken: cancellationToken); } - public async Task DeleteAsync(ArangoHandle database, string mount, + public async ValueTask DeleteAsync(ArangoHandle database, string mount, IDictionary queryParams = null, CancellationToken cancellationToken = default) { @@ -247,7 +247,7 @@ public async Task DeleteAsync(ArangoHandle database, string mount, cancellationToken: cancellationToken); } - public async Task DownloadServiceAsync(ArangoHandle database, string mount, + public async ValueTask DownloadServiceAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default) { var parameter = new Dictionary { { "mount", mount } }; @@ -259,7 +259,7 @@ public async Task DownloadServiceAsync(ArangoHandle database, string return await res.ReadAsStreamAsync(); } - public async Task RunServiceScriptAsync(ArangoHandle database, string mount, string name, + public async ValueTask RunServiceScriptAsync(ArangoHandle database, string mount, string name, object body = null, CancellationToken cancellationToken = default) { diff --git a/Core.Arango/Modules/Internal/ArangoFunctionModule.cs b/Core.Arango/Modules/Internal/ArangoFunctionModule.cs index 74c1c14982..609706af17 100644 --- a/Core.Arango/Modules/Internal/ArangoFunctionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoFunctionModule.cs @@ -16,7 +16,7 @@ internal ArangoFunctionModule(IArangoContext context) : base(context) { } - public async Task CreateAsync(ArangoHandle database, ArangoFunctionDefinition request, + public async ValueTask CreateAsync(ArangoHandle database, ArangoFunctionDefinition request, CancellationToken cancellationToken = default) { if (request == null) @@ -28,7 +28,7 @@ public async Task CreateAsync(ArangoHandle database, ArangoFunctionDefinit return res.IsNewlyCreated; } - public async Task RemoveAsync(ArangoHandle database, string name, bool? group = false, + public async ValueTask RemoveAsync(ArangoHandle database, string name, bool? group = false, CancellationToken cancellationToken = default) { var res = await SendAsync(database, HttpMethod.Delete, @@ -38,7 +38,7 @@ public async Task RemoveAsync(ArangoHandle database, string name, bool? gro return res.DeletedCount; } - public async Task> ListAsync(ArangoHandle database, + public async ValueTask> ListAsync(ArangoHandle database, string ns = null, CancellationToken cancellationToken = default) { diff --git a/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs b/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs index 2f0276b77e..42d96754d4 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs @@ -12,7 +12,7 @@ internal ArangoGraphEdgeModule(IArangoContext context) : base(context) { } - public async Task GetAsync(ArangoHandle database, string graph, string collection, string key, + public async ValueTask GetAsync(ArangoHandle database, string graph, string collection, string key, CancellationToken cancellationToken = default) { var res = await SendAsync>(database, HttpMethod.Get, @@ -22,7 +22,7 @@ public async Task GetAsync(ArangoHandle database, string graph, string c return res.Edge; } - public async Task> CreateAsync(ArangoHandle database, string graph, + public async ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default) @@ -31,7 +31,7 @@ public async Task> CreateAsync(ArangoHandle da cancellationToken); } - public async Task> UpdateAsync(ArangoHandle database, string graph, + public async ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -40,7 +40,7 @@ public async Task> UpdateAsync(ArangoHandle da returnNew, returnOld, cancellationToken); } - public async Task> ReplaceAsync(ArangoHandle database, string graph, + public async ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ public async Task> ReplaceAsync(ArangoHandle d returnNew, returnOld, cancellationToken); } - public async Task> RemoveAsync(ArangoHandle database, string graph, + public async ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -58,7 +58,7 @@ public async Task> RemoveAsync(ArangoHandle da cancellationToken); } - public async Task> CreateAsync(ArangoHandle database, string graph, + public async ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default) @@ -76,7 +76,7 @@ public async Task> CreateAsync(ArangoHandle databa doc, cancellationToken: cancellationToken); } - public async Task> UpdateAsync(ArangoHandle database, string graph, + public async ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -100,7 +100,7 @@ public async Task> UpdateAsync(ArangoHandle databa doc, cancellationToken: cancellationToken); } - public async Task> ReplaceAsync(ArangoHandle database, string graph, + public async ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -124,7 +124,7 @@ public async Task> ReplaceAsync(ArangoHandle datab doc, cancellationToken: cancellationToken); } - public async Task> RemoveAsync(ArangoHandle database, string graph, + public async ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default) diff --git a/Core.Arango/Modules/Internal/ArangoGraphModule.cs b/Core.Arango/Modules/Internal/ArangoGraphModule.cs index 190d7d4986..99408397b4 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphModule.cs @@ -17,7 +17,7 @@ internal ArangoGraphModule(IArangoContext context) : base(context) Edge = new ArangoGraphEdgeModule(context); } - public async Task> ListAsync(ArangoHandle database, + public async ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default) { var res = await SendAsync>(database, HttpMethod.Get, @@ -25,7 +25,7 @@ public async Task> ListAsync(ArangoHandle datab return res.Graphs; } - public async Task GetAsync(ArangoHandle database, string graph, + public async ValueTask GetAsync(ArangoHandle database, string graph, CancellationToken cancellationToken = default) { var res = await SendAsync>(database, HttpMethod.Get, diff --git a/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs b/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs index e2946d2339..7a2b8d69c1 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs @@ -12,7 +12,7 @@ internal ArangoGraphVertexModule(IArangoContext context) : base(context) { } - public async Task GetAsync(ArangoHandle database, string graph, string collection, string key, + public async ValueTask GetAsync(ArangoHandle database, string graph, string collection, string key, CancellationToken cancellationToken = default) { var res = await SendAsync>(database, HttpMethod.Get, @@ -22,7 +22,7 @@ public async Task GetAsync(ArangoHandle database, string graph, string c return res.Vertex; } - public async Task> CreateAsync(ArangoHandle database, string graph, + public async ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default) @@ -31,7 +31,7 @@ public async Task> CreateAsync(ArangoHandle cancellationToken); } - public async Task> CreateAsync(ArangoHandle database, string graph, + public async ValueTask> CreateAsync(ArangoHandle database, string graph, string collection, T doc, bool? waitForSync = null, bool? returnNew = null, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ public async Task> CreateAsync(ArangoHandle data doc, cancellationToken: cancellationToken); } - public async Task> UpdateAsync(ArangoHandle database, string graph, + public async ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -58,7 +58,7 @@ public async Task> UpdateAsync(ArangoHandle returnNew, returnOld, cancellationToken); } - public async Task> UpdateAsync(ArangoHandle database, string graph, + public async ValueTask> UpdateAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -82,7 +82,7 @@ public async Task> UpdateAsync(ArangoHandle data doc, cancellationToken: cancellationToken); } - public async Task> ReplaceAsync(ArangoHandle database, string graph, + public async ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -91,7 +91,7 @@ public async Task> ReplaceAsync(ArangoHandle returnNew, returnOld, cancellationToken); } - public async Task> ReplaceAsync(ArangoHandle database, string graph, + public async ValueTask> ReplaceAsync(ArangoHandle database, string graph, string collection, string key, T doc, bool? waitForSync = null, bool? keepNull = null, bool? returnNew = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -115,7 +115,7 @@ public async Task> ReplaceAsync(ArangoHandle dat doc, cancellationToken: cancellationToken); } - public async Task> RemoveAsync(ArangoHandle database, string graph, + public async ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default) @@ -124,7 +124,7 @@ public async Task> RemoveAsync(ArangoHandle dat cancellationToken); } - public async Task> RemoveAsync(ArangoHandle database, string graph, + public async ValueTask> RemoveAsync(ArangoHandle database, string graph, string collection, string key, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default) diff --git a/Core.Arango/Modules/Internal/ArangoIndexModule.cs b/Core.Arango/Modules/Internal/ArangoIndexModule.cs index 776acb8234..415a63f5d6 100644 --- a/Core.Arango/Modules/Internal/ArangoIndexModule.cs +++ b/Core.Arango/Modules/Internal/ArangoIndexModule.cs @@ -42,7 +42,7 @@ public async Task DropAllAsync(ArangoHandle database, CancellationToken cancella /// /// Ignores primary and edge indices /// - public async Task> ListAsync(ArangoHandle database, string collection, + public async ValueTask> ListAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { var res = await SendAsync(database, HttpMethod.Get, diff --git a/Core.Arango/Modules/Internal/ArangoModule.cs b/Core.Arango/Modules/Internal/ArangoModule.cs index d5d2742eac..bc84dcea3b 100644 --- a/Core.Arango/Modules/Internal/ArangoModule.cs +++ b/Core.Arango/Modules/Internal/ArangoModule.cs @@ -68,7 +68,7 @@ protected string UrlEncode(string value) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Task SendAsync(ArangoHandle handle, HttpMethod m, + public ValueTask SendAsync(ArangoHandle handle, HttpMethod m, string url, object body = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default) @@ -82,7 +82,7 @@ public Task SendAsync(ArangoHandle handle, HttpMethod m, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Task SendAsync(Type type, HttpMethod m, string url, object body = null, + public ValueTask SendAsync(Type type, HttpMethod m, string url, object body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default) diff --git a/Core.Arango/Modules/Internal/ArangoPregelModule.cs b/Core.Arango/Modules/Internal/ArangoPregelModule.cs index ae22e79a8a..112d28ad2a 100644 --- a/Core.Arango/Modules/Internal/ArangoPregelModule.cs +++ b/Core.Arango/Modules/Internal/ArangoPregelModule.cs @@ -11,7 +11,7 @@ internal ArangoPregelModule(IArangoContext context) : base(context) { } - public async Task StartJobAsync(ArangoHandle database, ArangoPregel job, + public async ValueTask StartJobAsync(ArangoHandle database, ArangoPregel job, CancellationToken cancellationToken = default) { return await SendAsync(database, HttpMethod.Post, @@ -19,7 +19,7 @@ public async Task StartJobAsync(ArangoHandle database, ArangoPregel job, job, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task GetJobStatusAsync(ArangoHandle database, string id, + public async ValueTask GetJobStatusAsync(ArangoHandle database, string id, CancellationToken cancellationToken = default) { return await SendAsync(database, HttpMethod.Get, diff --git a/Core.Arango/Modules/Internal/ArangoQueryModule.cs b/Core.Arango/Modules/Internal/ArangoQueryModule.cs index 3aa3f3515f..92524056fd 100644 --- a/Core.Arango/Modules/Internal/ArangoQueryModule.cs +++ b/Core.Arango/Modules/Internal/ArangoQueryModule.cs @@ -16,7 +16,7 @@ internal ArangoQueryModule(IArangoContext context) : base(context) { } - public async Task> FindAsync(ArangoHandle database, string collection, FormattableString filter, + public async ValueTask> FindAsync(ArangoHandle database, string collection, FormattableString filter, string projection = null, int limit = 1000, CancellationToken cancellationToken = default) { var filterExp = Parameterize(filter, out var parameter); @@ -26,7 +26,7 @@ public async Task> FindAsync(ArangoHandle database, string collection parameter, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task SingleOrDefaultAsync(ArangoHandle database, string collection, FormattableString filter, + public async ValueTask SingleOrDefaultAsync(ArangoHandle database, string collection, FormattableString filter, string projection = null, CancellationToken cancellationToken = default) { var results = await FindAsync(database, collection, filter, projection, 2, cancellationToken) @@ -37,7 +37,7 @@ public async Task SingleOrDefaultAsync(ArangoHandle database, string colle return results.SingleOrDefault(); } - public async Task> ExecuteAsync(ArangoHandle database, FormattableString query, + public async ValueTask> ExecuteAsync(ArangoHandle database, FormattableString query, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default) { var queryExp = Parameterize(query, out var parameter); @@ -46,7 +46,7 @@ public async Task> ExecuteAsync(ArangoHandle database, Formatta .ConfigureAwait(false); } - public async Task> ExecuteAsync(ArangoHandle database, string query, + public async ValueTask> ExecuteAsync(ArangoHandle database, string query, IDictionary bindVars, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default) { @@ -102,7 +102,7 @@ public async Task> ExecuteAsync(ArangoHandle database, string q } } - public async Task ExecuteAsync(Type type, bool isEnumerable, ArangoHandle database, string query, + public async ValueTask ExecuteAsync(Type type, bool isEnumerable, ArangoHandle database, string query, IDictionary bindVars, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default) { @@ -207,7 +207,7 @@ public async IAsyncEnumerable ExecuteStreamAsync(ArangoHandle database, Ar } } - public Task ExplainAsync(ArangoHandle database, string query, + public ValueTask ExplainAsync(ArangoHandle database, string query, IDictionary bindVars, bool allPlans = false, CancellationToken cancellationToken = default) @@ -224,7 +224,7 @@ public Task ExplainAsync(ArangoHandle database, string quer }, cancellationToken: cancellationToken); } - public Task ExplainAsync(ArangoHandle database, FormattableString query, + public ValueTask ExplainAsync(ArangoHandle database, FormattableString query, bool allPlans = false, CancellationToken cancellationToken = default) { @@ -233,7 +233,7 @@ public Task ExplainAsync(ArangoHandle database, Formattable return ExplainAsync(database, queryExp, parameter, allPlans, cancellationToken); } - public Task ParseAsync(ArangoHandle database, string query, + public ValueTask ParseAsync(ArangoHandle database, string query, CancellationToken cancellationToken = default) { return SendAsync(database, HttpMethod.Post, ApiPath(database, "query"), diff --git a/Core.Arango/Modules/Internal/ArangoTransactionModule.cs b/Core.Arango/Modules/Internal/ArangoTransactionModule.cs index fa97183294..3139e3e372 100644 --- a/Core.Arango/Modules/Internal/ArangoTransactionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoTransactionModule.cs @@ -12,7 +12,7 @@ internal ArangoTransactionModule(IArangoContext context) : base(context) { } - public async Task ExecuteAsync(ArangoHandle database, ArangoTransaction request, + public async ValueTask ExecuteAsync(ArangoHandle database, ArangoTransaction request, CancellationToken cancellationToken = default) { return await SendAsync(null, HttpMethod.Post, @@ -20,7 +20,7 @@ public async Task ExecuteAsync(ArangoHandle database, ArangoTransaction re request, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task BeginAsync(ArangoHandle database, ArangoTransaction request, + public async ValueTask BeginAsync(ArangoHandle database, ArangoTransaction request, CancellationToken cancellationToken = default) { var res = await SendAsync>(null, HttpMethod.Post, diff --git a/Core.Arango/Modules/Internal/ArangoUserModule.cs b/Core.Arango/Modules/Internal/ArangoUserModule.cs index d80ee13b03..4ac443af1b 100644 --- a/Core.Arango/Modules/Internal/ArangoUserModule.cs +++ b/Core.Arango/Modules/Internal/ArangoUserModule.cs @@ -16,7 +16,7 @@ internal ArangoUserModule(IArangoContext context) : base(context) /// /// Create a new user /// - public async Task CreateAsync(ArangoUser user, CancellationToken cancellationToken = default) + public async ValueTask CreateAsync(ArangoUser user, CancellationToken cancellationToken = default) { var res = await SendAsync(null, HttpMethod.Post, ApiPath("user"), user, cancellationToken: cancellationToken); @@ -27,7 +27,7 @@ public async Task CreateAsync(ArangoUser user, CancellationToken cancellat /// /// List available users /// - public async Task> ListAsync(CancellationToken cancellationToken = default) + public async ValueTask> ListAsync(CancellationToken cancellationToken = default) { var res = await SendAsync>(null, HttpMethod.Get, ApiPath("user"), cancellationToken: cancellationToken); @@ -37,7 +37,7 @@ public async Task> ListAsync(CancellationToken c /// /// Set the database access level /// - public async Task SetDatabaseAccessAsync(ArangoHandle handle, string user, ArangoAccess access, + public async ValueTask SetDatabaseAccessAsync(ArangoHandle handle, string user, ArangoAccess access, CancellationToken cancellationToken = default) { var res = await SendAsync(null, HttpMethod.Put, @@ -53,7 +53,7 @@ public async Task SetDatabaseAccessAsync(ArangoHandle handle, string user, /// /// Clear the database access level, revert back to the default access level /// - public async Task DeleteDatabaseAccessAsync(ArangoHandle handle, string user, + public async ValueTask DeleteDatabaseAccessAsync(ArangoHandle handle, string user, CancellationToken cancellationToken = default) { var res = await SendAsync(null, HttpMethod.Delete, @@ -66,7 +66,7 @@ public async Task DeleteDatabaseAccessAsync(ArangoHandle handle, string us /// /// Modify attributes of an existing user /// - public async Task PatchAsync(ArangoUser user, CancellationToken cancellationToken = default) + public async ValueTask PatchAsync(ArangoUser user, CancellationToken cancellationToken = default) { var res = await SendAsync(null, PolyfillHelper.Patch, ApiPath($"user/{UrlEncode(user.Name)}"), @@ -79,7 +79,7 @@ public async Task PatchAsync(ArangoUser user, CancellationToken cancellati /// /// Delete a user permanently. /// - public async Task DeleteAsync(string user, CancellationToken cancellationToken = default) + public async ValueTask DeleteAsync(string user, CancellationToken cancellationToken = default) { var res = await SendAsync(null, HttpMethod.Delete, ApiPath($"user/{UrlEncode(user)}"), cancellationToken: cancellationToken); diff --git a/Core.Arango/Modules/Internal/ArangoViewModule.cs b/Core.Arango/Modules/Internal/ArangoViewModule.cs index 030d62c802..f5a16537e6 100644 --- a/Core.Arango/Modules/Internal/ArangoViewModule.cs +++ b/Core.Arango/Modules/Internal/ArangoViewModule.cs @@ -38,7 +38,7 @@ await SendAsync(database, PolyfillHelper.Patch, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task> ListAsync(ArangoHandle database, + public async ValueTask> ListAsync(ArangoHandle database, CancellationToken cancellationToken = default) { var res = await SendAsync>(database, HttpMethod.Get, @@ -47,7 +47,7 @@ public async Task> ListAsync(ArangoHa return res.Result; } - public async Task GetPropertiesAsync(ArangoHandle database, string view, + public async ValueTask GetPropertiesAsync(ArangoHandle database, string view, CancellationToken cancellationToken = default) { var res = await SendAsync(database, HttpMethod.Get, diff --git a/Core.Arango/Transport/ArangoHttpTransport.cs b/Core.Arango/Transport/ArangoHttpTransport.cs index 304c98b912..b363826a77 100644 --- a/Core.Arango/Transport/ArangoHttpTransport.cs +++ b/Core.Arango/Transport/ArangoHttpTransport.cs @@ -35,7 +35,7 @@ public ArangoHttpTransport(IArangoConfiguration configuration) } /// - public async Task SendAsync(HttpMethod m, string url, object body = null, + public async ValueTask SendAsync(HttpMethod m, string url, object body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default) @@ -87,7 +87,7 @@ public async Task SendAsync(HttpMethod m, string url, object body = null, } /// - public async Task SendContentAsync(HttpMethod m, string url, HttpContent body = null, + public async ValueTask SendContentAsync(HttpMethod m, string url, HttpContent body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default) @@ -113,7 +113,7 @@ public async Task SendContentAsync(HttpMethod m, string url, HttpCo } /// - public async Task SendAsync(Type type, HttpMethod m, string url, object body = null, + public async ValueTask SendAsync(Type type, HttpMethod m, string url, object body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default) diff --git a/Core.Arango/Transport/IArangoTransport.cs b/Core.Arango/Transport/IArangoTransport.cs index f16f2e0318..8062510694 100644 --- a/Core.Arango/Transport/IArangoTransport.cs +++ b/Core.Arango/Transport/IArangoTransport.cs @@ -14,21 +14,21 @@ public interface IArangoTransport /// /// Send request to ArangoDB /// - Task SendAsync(Type type, HttpMethod m, string url, object body = null, string transaction = null, + ValueTask SendAsync(Type type, HttpMethod m, string url, object body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default); /// /// Send request to ArangoDB /// - Task SendAsync(HttpMethod m, string url, object body = null, string transaction = null, + ValueTask SendAsync(HttpMethod m, string url, object body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default); /// /// Send raw HTTP content request to ArangoDB /// - Task SendContentAsync(HttpMethod m, string url, HttpContent body = null, string transaction = null, + ValueTask SendContentAsync(HttpMethod m, string url, HttpContent body = null, string transaction = null, bool throwOnError = true, bool auth = true, IDictionary headers = null, CancellationToken cancellationToken = default); } From 6dc30f988cf624ca51d03f8fa82aeeb31d1544cd Mon Sep 17 00:00:00 2001 From: Harry Cordewener Date: Sat, 16 Nov 2024 11:23:38 -0600 Subject: [PATCH 2/4] More ValueTasks, more Fast. --- Core.Arango.Tests/AnalyzerViewTest.cs | 2 +- Core.Arango.Tests/BackupTest.cs | 2 +- Core.Arango.Tests/CamelCaseTest.cs | 2 +- Core.Arango.Tests/CollectionTest.cs | 6 +-- Core.Arango.Tests/Core/TestBase.cs | 6 +-- Core.Arango.Tests/DatabaseTest.cs | 4 +- Core.Arango.Tests/DocumentTest.cs | 22 ++++----- Core.Arango.Tests/FoxxTest.cs | 4 +- Core.Arango.Tests/FunctionTest.cs | 2 +- Core.Arango.Tests/GraphTest.cs | 6 +-- Core.Arango.Tests/IndexTest.cs | 2 +- Core.Arango.Tests/LinqTest.cs | 40 ++++++++-------- Core.Arango.Tests/LinqTest_BasicOperations.cs | 48 +++++++++---------- Core.Arango.Tests/LinqTest_String.cs | 26 +++++----- Core.Arango.Tests/QueryFormattingTest.cs | 4 +- Core.Arango.Tests/QueryStatisticTest.cs | 4 +- Core.Arango.Tests/QueryTest.cs | 16 +++---- Core.Arango.Tests/TransactionTest.cs | 8 ++-- Core.Arango/Core.Arango.xml | 8 ++-- Core.Arango/Modules/IArangoAnalyzerModule.cs | 4 +- Core.Arango/Modules/IArangoBackupModule.cs | 4 +- .../Modules/IArangoCollectionModule.cs | 16 +++---- Core.Arango/Modules/IArangoDatabaseModule.cs | 2 +- Core.Arango/Modules/IArangoDocumentModule.cs | 2 +- Core.Arango/Modules/IArangoFoxxModule.cs | 4 +- Core.Arango/Modules/IArangoGraphModule.cs | 14 +++--- Core.Arango/Modules/IArangoIndexModule.cs | 6 +-- Core.Arango/Modules/IArangoPregelModule.cs | 2 +- .../Modules/IArangoTransactionModule.cs | 4 +- Core.Arango/Modules/IArangoViewModule.cs | 10 ++-- .../Modules/Internal/ArangoAnalyzerModule.cs | 4 +- .../Modules/Internal/ArangoBackupModule.cs | 4 +- .../Internal/ArangoCollectionModule.cs | 16 +++---- .../Modules/Internal/ArangoDatabaseModule.cs | 2 +- .../Modules/Internal/ArangoDocumentModule.cs | 2 +- .../Modules/Internal/ArangoFoxxModule.cs | 4 +- .../Modules/Internal/ArangoGraphModule.cs | 14 +++--- .../Modules/Internal/ArangoIndexModule.cs | 6 +-- .../Modules/Internal/ArangoPregelModule.cs | 2 +- .../Internal/ArangoTransactionModule.cs | 4 +- .../Modules/Internal/ArangoViewModule.cs | 10 ++-- Core.Arango/Transport/ArangoHttpTransport.cs | 2 +- 42 files changed, 175 insertions(+), 175 deletions(-) diff --git a/Core.Arango.Tests/AnalyzerViewTest.cs b/Core.Arango.Tests/AnalyzerViewTest.cs index 0cd53040fc..cca4aed58b 100644 --- a/Core.Arango.Tests/AnalyzerViewTest.cs +++ b/Core.Arango.Tests/AnalyzerViewTest.cs @@ -10,7 +10,7 @@ public class AnalyzerViewTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async Task AnalyzersViews(string serializer) + public async ValueTask AnalyzersViews(string serializer) { await SetupAsync(serializer); diff --git a/Core.Arango.Tests/BackupTest.cs b/Core.Arango.Tests/BackupTest.cs index 7eae31835a..2d21e77514 100644 --- a/Core.Arango.Tests/BackupTest.cs +++ b/Core.Arango.Tests/BackupTest.cs @@ -3,7 +3,7 @@ namespace Core.Arango.Tests /*public class BackupTest : TestBase { [Fact] - public async Task BackupRestoreDelete() + public async ValueTask BackupRestoreDelete() { await SetupAsync("system-camel"); diff --git a/Core.Arango.Tests/CamelCaseTest.cs b/Core.Arango.Tests/CamelCaseTest.cs index 84d46470ca..2ac8dd51c4 100644 --- a/Core.Arango.Tests/CamelCaseTest.cs +++ b/Core.Arango.Tests/CamelCaseTest.cs @@ -10,7 +10,7 @@ public class CamelCaseTest : TestBase { [Theory] [ClassData(typeof(CamelCaseData))] - public async Task GetCamelCase(string serializer) + public async ValueTask GetCamelCase(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/CollectionTest.cs b/Core.Arango.Tests/CollectionTest.cs index 862f23f395..aad6e8cff2 100644 --- a/Core.Arango.Tests/CollectionTest.cs +++ b/Core.Arango.Tests/CollectionTest.cs @@ -18,7 +18,7 @@ public CollectionTest(ITestOutputHelper output) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Create(string serializer) + public async ValueTask Create(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", new ArangoCollection @@ -40,7 +40,7 @@ public async Task Create(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CreateExistGetDrop(string serializer) + public async ValueTask CreateExistGetDrop(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", new ArangoCollection @@ -63,7 +63,7 @@ public async Task CreateExistGetDrop(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Schema(string serializer) + public async ValueTask Schema(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) diff --git a/Core.Arango.Tests/Core/TestBase.cs b/Core.Arango.Tests/Core/TestBase.cs index db9ee489f8..d55f3937b5 100644 --- a/Core.Arango.Tests/Core/TestBase.cs +++ b/Core.Arango.Tests/Core/TestBase.cs @@ -14,12 +14,12 @@ public abstract class TestBase : IAsyncLifetime { public IArangoContext Arango { get; protected set; } - public virtual Task InitializeAsync() + public virtual ValueTask InitializeAsync() { return Task.CompletedTask; } - public async Task DisposeAsync() + public async ValueTask DisposeAsync() { try { @@ -32,7 +32,7 @@ public async Task DisposeAsync() } } - public async Task SetupAsync(string serializer, string createDatabase = "test") + public async ValueTask SetupAsync(string serializer, string createDatabase = "test") { Arango = new ArangoContext(UniqueTestRealm(), new ArangoConfiguration { diff --git a/Core.Arango.Tests/DatabaseTest.cs b/Core.Arango.Tests/DatabaseTest.cs index 5f54097318..e03fbbdc26 100644 --- a/Core.Arango.Tests/DatabaseTest.cs +++ b/Core.Arango.Tests/DatabaseTest.cs @@ -18,7 +18,7 @@ public DatabaseTest(ITestOutputHelper output) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Create(string serializer) + public async ValueTask Create(string serializer) { await SetupAsync(serializer, null); @@ -39,7 +39,7 @@ await Arango.Database.CreateAsync(new ArangoDatabase [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Drop(string serializer) + public async ValueTask Drop(string serializer) { await SetupAsync(serializer, null); diff --git a/Core.Arango.Tests/DocumentTest.cs b/Core.Arango.Tests/DocumentTest.cs index 5d8a65fa07..f7c0cccf0d 100644 --- a/Core.Arango.Tests/DocumentTest.cs +++ b/Core.Arango.Tests/DocumentTest.cs @@ -13,7 +13,7 @@ public class DocumentTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Get(string serializer) + public async ValueTask Get(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -50,7 +50,7 @@ public async Task Get(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Update(string serializer) + public async ValueTask Update(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -88,7 +88,7 @@ public async Task Update(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CreateUpdateMode(string serializer) + public async ValueTask CreateUpdateMode(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) @@ -124,7 +124,7 @@ public async Task CreateUpdateMode(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CreateReplaceMode(string serializer) + public async ValueTask CreateReplaceMode(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) @@ -160,7 +160,7 @@ public async Task CreateReplaceMode(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CreateSilent(string serializer) + public async ValueTask CreateSilent(string serializer) { await SetupAsync(serializer); @@ -175,7 +175,7 @@ public async Task CreateSilent(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CreateManySilent(string serializer) + public async ValueTask CreateManySilent(string serializer) { await SetupAsync(serializer); @@ -198,7 +198,7 @@ public async Task CreateManySilent(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task DeleteMany(string serializer) + public async ValueTask DeleteMany(string serializer) { await SetupAsync(serializer); @@ -240,7 +240,7 @@ public async Task DeleteMany(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CreateConflictMode(string serializer) + public async ValueTask CreateConflictMode(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) @@ -271,7 +271,7 @@ public async Task CreateConflictMode(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task OptimisticConcurrency(string serializer) + public async ValueTask OptimisticConcurrency(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -308,7 +308,7 @@ public async Task OptimisticConcurrency(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task OptimisticConcurrencyMulti(string serializer) + public async ValueTask OptimisticConcurrencyMulti(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -354,7 +354,7 @@ public async Task OptimisticConcurrencyMulti(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task GetManyTest(string serializer) + public async ValueTask GetManyTest(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/FoxxTest.cs b/Core.Arango.Tests/FoxxTest.cs index 514efaf56e..841977a27a 100644 --- a/Core.Arango.Tests/FoxxTest.cs +++ b/Core.Arango.Tests/FoxxTest.cs @@ -14,7 +14,7 @@ namespace Core.Arango.Tests public class FoxxTest : TestBase { [Fact] - public async Task InstallScript() + public async ValueTask InstallScript() { await SetupAsync("system-camel"); @@ -101,7 +101,7 @@ await index.WriteAsync(Encoding.UTF8.GetBytes($@" } [Fact] - public async Task InstallZip() + public async ValueTask InstallZip() { await SetupAsync("system-camel"); diff --git a/Core.Arango.Tests/FunctionTest.cs b/Core.Arango.Tests/FunctionTest.cs index d98bf0dc8a..08d341d5c8 100644 --- a/Core.Arango.Tests/FunctionTest.cs +++ b/Core.Arango.Tests/FunctionTest.cs @@ -14,7 +14,7 @@ public class FunctionTest : TestBase [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Run(string serializer) + public async ValueTask Run(string serializer) { await SetupAsync(serializer); var function = Arango.Function; diff --git a/Core.Arango.Tests/GraphTest.cs b/Core.Arango.Tests/GraphTest.cs index ea0a6189bb..8ae859b2f1 100644 --- a/Core.Arango.Tests/GraphTest.cs +++ b/Core.Arango.Tests/GraphTest.cs @@ -11,7 +11,7 @@ public class GraphTest : TestBase { [Theory] [ClassData(typeof(CamelCaseData))] - public async Task Get(string serializer) + public async ValueTask Get(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "vertices", ArangoCollectionType.Document); @@ -108,7 +108,7 @@ public async Task Get(string serializer) [Theory] [ClassData(typeof(CamelCaseData))] - public async Task TransactionalOperations(string serializer) + public async ValueTask TransactionalOperations(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "vertices", ArangoCollectionType.Document); @@ -230,7 +230,7 @@ public async Task TransactionalOperations(string serializer) [Theory] [ClassData(typeof(CamelCaseData))] - public async Task ReplaceEdgeDefinition(string serializer) + public async ValueTask ReplaceEdgeDefinition(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "vertices1", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/IndexTest.cs b/Core.Arango.Tests/IndexTest.cs index b77a83e136..26679cf46d 100644 --- a/Core.Arango.Tests/IndexTest.cs +++ b/Core.Arango.Tests/IndexTest.cs @@ -10,7 +10,7 @@ public class IndexTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async Task DropAll(string serializer) + public async ValueTask DropAll(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/LinqTest.cs b/Core.Arango.Tests/LinqTest.cs index 2e7fa9ccee..bc164762f2 100644 --- a/Core.Arango.Tests/LinqTest.cs +++ b/Core.Arango.Tests/LinqTest.cs @@ -25,7 +25,7 @@ public LinqTest(ITestOutputHelper output) } [Fact] - public async Task SelectDocument() + public async ValueTask SelectDocument() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -42,7 +42,7 @@ public async Task SelectDocument() } [Fact] - public async Task FirstOrDefault() + public async ValueTask FirstOrDefault() { var p = await Arango.Query("test") .FirstOrDefaultAsync(x => x.Name == "Project A"); @@ -51,7 +51,7 @@ public async Task FirstOrDefault() } [Fact] - public async Task SingleOrDefault() + public async ValueTask SingleOrDefault() { var p = await Arango.Query("test") .SingleOrDefaultAsync(x => x.Name == "Project A"); @@ -60,7 +60,7 @@ public async Task SingleOrDefault() } [Fact] - public async Task SingleException() + public async ValueTask SingleException() { await Assert.ThrowsAsync(async () => { @@ -70,7 +70,7 @@ await Arango.Query("test") } [Fact] - public async Task MultiFilter() + public async ValueTask MultiFilter() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -84,7 +84,7 @@ public async Task MultiFilter() [Fact] - public async Task FilterOrder() + public async ValueTask FilterOrder() { var q = Arango.Query("test") .Where(x => (x.Name == "Project A" || x.Name == "Project B") && x.Budget <= 0); @@ -93,7 +93,7 @@ public async Task FilterOrder() } [Fact] - public Task Options() + public ValueTask Options() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -105,7 +105,7 @@ public Task Options() } [Fact] - public async Task GroupBy() + public async ValueTask GroupBy() { var q = Arango.Query("test") .GroupBy(y => y.ParentKey) @@ -121,7 +121,7 @@ public async Task GroupBy() } [Fact] - public async Task MathAbs() + public async ValueTask MathAbs() { var q = Arango.Query("test") .Select(x => new @@ -136,7 +136,7 @@ public async Task MathAbs() } [Fact] - public async Task Ternary() + public async ValueTask Ternary() { var q = Arango.Query("test") .Select(x => new @@ -151,7 +151,7 @@ public async Task Ternary() } [Fact] - public async Task Update() + public async ValueTask Update() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -167,7 +167,7 @@ public async Task Update() } [Fact] - public async Task Remove() + public async ValueTask Remove() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -177,7 +177,7 @@ public async Task Remove() } [Fact] - public async Task Let() + public async ValueTask Let() { var q = from p in Arango.Query("test") @@ -190,7 +190,7 @@ from p in Arango.Query("test") } [Fact] - public async Task ListContains() + public async ValueTask ListContains() { var list = new List { "CB" }.ToArray(); @@ -210,7 +210,7 @@ public async Task ListContains() } [Fact] - public async Task QueryableContains() + public async ValueTask QueryableContains() { var q = Arango.Query("test") .Select(x => x.ClientKey) @@ -219,7 +219,7 @@ public async Task QueryableContains() Assert.True(q); } - public override async Task InitializeAsync() + public override async ValueTask InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm()); await Arango.Database.CreateAsync(D); @@ -259,7 +259,7 @@ public override async Task InitializeAsync() } [Fact] - public async Task Count_SubQuery() + public async ValueTask Count_SubQuery() { var q = Arango.Query("test") .Select(c => Arango.Query().Where(p => p.ClientKey == c.Key).Count()); @@ -272,7 +272,7 @@ public async Task Count_SubQuery() } /*[Fact] - public async Task Except_SubQuery() + public async ValueTask Except_SubQuery() { var list = await Arango.Query("test") .Take(1) @@ -294,7 +294,7 @@ public async Task Except_SubQuery() }*/ [Fact] - public async Task StringContains() + public async ValueTask StringContains() { var q = Arango.Query("test").Where(x => x.Name.Contains("abc")); var aql = q.ToAql().aql.Trim(); @@ -303,7 +303,7 @@ public async Task StringContains() } [Fact] - public async Task StringConcat() + public async ValueTask StringConcat() { var q = Arango.Query("test").Where(x => string.Concat(x.Name, "Suffix") == "TestSuffix"); var aql = q.ToAql().aql.Trim(); diff --git a/Core.Arango.Tests/LinqTest_BasicOperations.cs b/Core.Arango.Tests/LinqTest_BasicOperations.cs index 46d68ebb63..f0bf1d2975 100644 --- a/Core.Arango.Tests/LinqTest_BasicOperations.cs +++ b/Core.Arango.Tests/LinqTest_BasicOperations.cs @@ -64,7 +64,7 @@ public void Any() } [Fact] - public async Task GroupBy() + public async ValueTask GroupBy() { var q = Arango.Query("test") .GroupBy(x => new @@ -85,7 +85,7 @@ public async Task GroupBy() } /*[Fact] - public async Task GroupJoin() + public async ValueTask GroupJoin() { var magnus = new Person { Name = "Hedlund, Magnus", Key = "Per1" }; var terry = new Person { Name = "Adams, Terry", Key = "Per2" }; @@ -127,7 +127,7 @@ public async Task GroupJoin() /*//Check the AQL being generated [Fact] - public async Task Join() + public async ValueTask Join() { var magnus = new Person { Name = "Hedlund, Magnus", Key = "Per1" }; var terry = new Person { Name = "Adams, Terry", Key = "Per2" }; @@ -187,7 +187,7 @@ public void Count_Result() } [Fact] - public async Task Count_In_Filter() + public async ValueTask Count_In_Filter() { var q = Arango.Query("test") .Where(x => x.Notes.Count() == 3); @@ -200,7 +200,7 @@ public async Task Count_In_Filter() } [Fact] - public async Task Count_In_Select() + public async ValueTask Count_In_Select() { var q = Arango.Query("test") .Select(x => x.Notes.Count()); @@ -223,7 +223,7 @@ public void All() } [Fact] - public async Task Contains() + public async ValueTask Contains() { var p = await Arango.Query("test").FirstOrDefaultAsync(); @@ -235,7 +235,7 @@ public async Task Contains() } /*[Fact] - public async Task Distinct() + public async ValueTask Distinct() { var per1 = new Person { Name = "Person1", Key = "Per1" }; var per2 = new Person { Name = "Person1", Key = "Per2" }; @@ -255,7 +255,7 @@ public async Task Distinct() }*/ /*[Fact] - public async Task Except_Compare_Objects() + public async ValueTask Except_Compare_Objects() { var list = await Arango.Query("test") .Take(2) @@ -272,7 +272,7 @@ public async Task Except_Compare_Objects() }*/ [Fact] - public async Task Except_Compare_Keys() + public async ValueTask Except_Compare_Keys() { var list = await Arango.Query("test") .Take(2) @@ -291,7 +291,7 @@ public async Task Except_Compare_Keys() } [Fact] - public async Task Combine_Skip_Take() + public async ValueTask Combine_Skip_Take() { var q = Arango.Query("test") .Skip(1) @@ -306,7 +306,7 @@ public async Task Combine_Skip_Take() } /*[Fact] - public async Task Intersect() + public async ValueTask Intersect() { var list = await Arango.Query("test").Take(1).ToListAsync(); @@ -320,7 +320,7 @@ public async Task Intersect() } [Fact] - public async Task Intersect_With_Count() + public async ValueTask Intersect_With_Count() { var list = await Arango.Query("test").Take(1).ToListAsync(); @@ -330,7 +330,7 @@ public async Task Intersect_With_Count() }*/ [Fact] - public async Task Union() + public async ValueTask Union() { var personList1 = new List { @@ -367,7 +367,7 @@ public async Task Union() /*//This test has precision issues. [Fact] - public async Task Average() + public async ValueTask Average() { var expectedAverage = (new List { 3.4m, 4.4m }).AsQueryable().Average(); var average = Arango.Query("test").Where(x => x.Key == "AA" || x.Key == "AB").Select(x => x.Revenue).Average(); @@ -376,7 +376,7 @@ public async Task Average() }*/ [Fact] - public async Task Min() + public async ValueTask Min() { var min = Arango.Query("test").Select(x => x.Revenue).Min(); @@ -384,7 +384,7 @@ public async Task Min() } [Fact] - public async Task Max() + public async ValueTask Max() { var max = Arango.Query("test").Select(x => x.Revenue).Max(); @@ -392,7 +392,7 @@ public async Task Max() } [Fact] - public async Task Sum() + public async ValueTask Sum() { var expectedSum = (4.4m * 4) + 3.4m; var sum = Arango.Query("test").Select(x => x.Revenue).Sum(); @@ -401,7 +401,7 @@ public async Task Sum() } /*[Fact] - public async Task SameVariableChained() + public async ValueTask SameVariableChained() { var chainTest = new OutterChain() { @@ -444,7 +444,7 @@ public async Task SameVariableChained() }*/ /*[Fact] - public async Task Cast() + public async ValueTask Cast() { Person per1 = new Person { Name = "Person1", Key = "Per1" }; Person per2 = new Person { Name = "Person1", Key = "Per2" }; @@ -462,35 +462,35 @@ public async Task Cast() }*/ /*[Fact] - public async Task Last() + public async ValueTask Last() { var a = Arango.Query("test").LastOrDefault(); Assert.Equal("AE", a.Key); } [Fact] - public async Task Reverse() + public async ValueTask Reverse() { var a = await Arango.Query("test").Reverse().FirstOrDefaultAsync(); Assert.Equal("AE", a.Key); }*/ [Fact] - public async Task Single() + public async ValueTask Single() { var a = await Arango.Query("test").Where(x => x.Key == "AA").SingleOrDefaultAsync(); Assert.Equal("AA", a.Key); } [Fact] - public async Task Take() + public async ValueTask Take() { var a = await Arango.Query("test").Take(2).ToListAsync(); Assert.Equal("AA", a[0].Key); Assert.Equal("AB", a[1].Key); } - public override async Task InitializeAsync() + public override async ValueTask InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm()); await Arango.Database.CreateAsync(D); diff --git a/Core.Arango.Tests/LinqTest_String.cs b/Core.Arango.Tests/LinqTest_String.cs index a7726a3d22..e677c69372 100644 --- a/Core.Arango.Tests/LinqTest_String.cs +++ b/Core.Arango.Tests/LinqTest_String.cs @@ -23,7 +23,7 @@ public LinqTest_String(ITestOutputHelper output) } [Fact] - public async Task StringConcat() + public async ValueTask StringConcat() { var q = Arango.Query("test").Where(x => String.Concat(x.Name, " 10") == "Project A 10"); var p = await q.FirstOrDefaultAsync(); @@ -33,7 +33,7 @@ public async Task StringConcat() } [Fact] - public async Task StringContains() + public async ValueTask StringContains() { var q = Arango.Query("test").Where(x => x.Name.Contains("A")); var p = await q.FirstOrDefaultAsync(); @@ -44,7 +44,7 @@ public async Task StringContains() /*//Not working at the moment. Check the comment on the second Assert. [Fact] - public async Task StringTrim() + public async ValueTask StringTrim() { await Arango.Document.CreateManyAsync(D, nameof(Project), new List { @@ -80,7 +80,7 @@ public async Task StringTrim() }*/ [Fact] - public async Task StringTrimStart() + public async ValueTask StringTrimStart() { await Arango.Document.CreateManyAsync(D, nameof(Project), new List { @@ -114,7 +114,7 @@ public async Task StringTrimStart() } [Fact] - public async Task StringTrimEnd() + public async ValueTask StringTrimEnd() { await Arango.Document.CreateManyAsync(D, nameof(Project), new List { @@ -148,7 +148,7 @@ public async Task StringTrimEnd() } [Fact] - public async Task StringLen() + public async ValueTask StringLen() { var q = Arango.Query("test").Where(x => x.Name.Length == "Project A".Length); var p = await q.FirstOrDefaultAsync(); @@ -158,7 +158,7 @@ public async Task StringLen() } [Fact] - public async Task StringIndexOf() + public async ValueTask StringIndexOf() { var q = Arango.Query("test").Where(x => x.Name.IndexOf("A") == "Project A".IndexOf("A")); var p = await q.FirstOrDefaultAsync(); @@ -168,7 +168,7 @@ public async Task StringIndexOf() } [Fact] - public async Task StringSplit() + public async ValueTask StringSplit() { char[] splitChars = { ' ' }; @@ -180,7 +180,7 @@ public async Task StringSplit() } [Fact] - public async Task StringReplace() + public async ValueTask StringReplace() { var q = Arango.Query("test").Where(x => x.Name.Replace('A', 'C') == "Project C"); var p = await q.FirstOrDefaultAsync(); @@ -190,7 +190,7 @@ public async Task StringReplace() } [Fact] - public async Task StringSubstring() + public async ValueTask StringSubstring() { var q1 = Arango.Query("test").Where(x => x.Name.Substring(8) == "A"); var q2 = Arango.Query("test").Where(x => x.Name.Substring(1, 8) == "roject A"); @@ -206,7 +206,7 @@ public async Task StringSubstring() } [Fact] - public async Task StringToLower() + public async ValueTask StringToLower() { var q = Arango.Query("test").Where(x => x.Name.ToLower() == "project a"); var p = await q.FirstOrDefaultAsync(); @@ -216,7 +216,7 @@ public async Task StringToLower() } [Fact] - public async Task StringToUpper() + public async ValueTask StringToUpper() { var q = Arango.Query("test").Where(x => x.Name.ToUpper() == "PROJECT A"); var p = await q.FirstOrDefaultAsync(); @@ -225,7 +225,7 @@ public async Task StringToUpper() _output.WriteLine(q.ToAql().aql); } - public override async Task InitializeAsync() + public override async ValueTask InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm()); await Arango.Database.CreateAsync(D); diff --git a/Core.Arango.Tests/QueryFormattingTest.cs b/Core.Arango.Tests/QueryFormattingTest.cs index be1772281f..2c90a86739 100644 --- a/Core.Arango.Tests/QueryFormattingTest.cs +++ b/Core.Arango.Tests/QueryFormattingTest.cs @@ -11,7 +11,7 @@ public class QueryFormattingTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async Task GuidFormat(string serializer) + public async ValueTask GuidFormat(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -25,7 +25,7 @@ public async Task GuidFormat(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task DateTimeFormat(string serializer) + public async ValueTask DateTimeFormat(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/QueryStatisticTest.cs b/Core.Arango.Tests/QueryStatisticTest.cs index 2ab326ba37..29704e5acd 100644 --- a/Core.Arango.Tests/QueryStatisticTest.cs +++ b/Core.Arango.Tests/QueryStatisticTest.cs @@ -18,7 +18,7 @@ public QueryStatisticTest(ITestOutputHelper output) _output = output; } - public override async Task InitializeAsync() + public override async ValueTask InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm(), @@ -39,7 +39,7 @@ public override async Task InitializeAsync() } [Fact] - public async Task QueryStats() + public async ValueTask QueryStats() { await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/QueryTest.cs b/Core.Arango.Tests/QueryTest.cs index ede41e576e..3d410e5779 100644 --- a/Core.Arango.Tests/QueryTest.cs +++ b/Core.Arango.Tests/QueryTest.cs @@ -21,7 +21,7 @@ public QueryTest(ITestOutputHelper output) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task NullParameter(string serializer) + public async ValueTask NullParameter(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -43,7 +43,7 @@ public async Task NullParameter(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task QueryIntegerContains(string serializer) + public async ValueTask QueryIntegerContains(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -64,7 +64,7 @@ public async Task QueryIntegerContains(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task CollectionNameParameter(string serializer) + public async ValueTask CollectionNameParameter(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -86,7 +86,7 @@ public async Task CollectionNameParameter(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task InlineFormattable(string serializer) + public async ValueTask InlineFormattable(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -111,7 +111,7 @@ public async Task InlineFormattable(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Batch(string serializer) + public async ValueTask Batch(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -128,7 +128,7 @@ await Arango.Document.CreateManyAsync("test", "test", [Theory] [ClassData(typeof(PascalCaseData))] - public async Task BatchStream(string serializer) + public async ValueTask BatchStream(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -148,7 +148,7 @@ await Arango.Document.CreateManyAsync("test", "test", [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Explain(string serializer) + public async ValueTask Explain(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -169,7 +169,7 @@ public async Task Explain(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task Parse(string serializer) + public async ValueTask Parse(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/TransactionTest.cs b/Core.Arango.Tests/TransactionTest.cs index f1523cf2b3..ecac54709c 100644 --- a/Core.Arango.Tests/TransactionTest.cs +++ b/Core.Arango.Tests/TransactionTest.cs @@ -13,7 +13,7 @@ public class TransactionTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async Task StreamTransaction(string serializer) + public async ValueTask StreamTransaction(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -62,7 +62,7 @@ public async Task StreamTransaction(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task StreamTransactionQuery(string serializer) + public async ValueTask StreamTransactionQuery(string serializer) { var documents = new List { @@ -120,9 +120,9 @@ public async Task StreamTransactionQuery(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async Task StreamTransactionBatchStreamQuery(string serializer) + public async ValueTask StreamTransactionBatchStreamQuery(string serializer) { - async Task AssertStreamQuery(ArangoHandle handle, int expected) + async ValueTask AssertStreamQuery(ArangoHandle handle, int expected) { var i = 0; diff --git a/Core.Arango/Core.Arango.xml b/Core.Arango/Core.Arango.xml index 4dcebc5bbb..d76a6a765f 100644 --- a/Core.Arango/Core.Arango.xml +++ b/Core.Arango/Core.Arango.xml @@ -935,13 +935,13 @@ cant distinguish a valid mode for provided LDAP configuration - Will be raised when a task is created with an invalid id. + Will be raised when a ValueTask is created with an invalid id. - Will be raised when a task id is created with a duplicate id. + Will be raised when a ValueTask id is created with a duplicate id. - Will be raised when a task with the specified id could not be found. + Will be raised when a ValueTask with the specified id could not be found. Will be raised when an invalid name is passed to the server. @@ -5775,7 +5775,7 @@ - For example, consider the task of determining the value of a specific query source [s] from an input value + For example, consider the ValueTask of determining the value of a specific query source [s] from an input value corresponding to a complex expression. This will return a able to perform this task. diff --git a/Core.Arango/Modules/IArangoAnalyzerModule.cs b/Core.Arango/Modules/IArangoAnalyzerModule.cs index 20aa7de1dc..1d0a35d922 100644 --- a/Core.Arango/Modules/IArangoAnalyzerModule.cs +++ b/Core.Arango/Modules/IArangoAnalyzerModule.cs @@ -13,7 +13,7 @@ public interface IArangoAnalyzerModule /// /// creates a new Analyzer based on the provided definition /// - Task CreateAsync(ArangoHandle database, ArangoAnalyzer analyzer, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoHandle database, ArangoAnalyzer analyzer, CancellationToken cancellationToken = default); /// /// removes an Analyzer configuration @@ -22,7 +22,7 @@ public interface IArangoAnalyzerModule /// The name of the Analyzer to remove. /// The Analyzer configuration should be removed even if it is in-use. The default value is false. /// - Task DeleteAsync(ArangoHandle database, string analyzer, bool force = false, + ValueTask DeleteAsync(ArangoHandle database, string analyzer, bool force = false, CancellationToken cancellationToken = default); /// diff --git a/Core.Arango/Modules/IArangoBackupModule.cs b/Core.Arango/Modules/IArangoBackupModule.cs index 6edf1e0754..9f0225fc07 100644 --- a/Core.Arango/Modules/IArangoBackupModule.cs +++ b/Core.Arango/Modules/IArangoBackupModule.cs @@ -18,12 +18,12 @@ public interface IArangoBackupModule /// /// Restores from a local backup. /// - Task RestoreAsync(string id, CancellationToken cancellationToken = default); + ValueTask RestoreAsync(string id, CancellationToken cancellationToken = default); /// /// Delete a specific local backup. /// - Task DeleteAsync(string id, CancellationToken cancellationToken = default); + ValueTask DeleteAsync(string id, CancellationToken cancellationToken = default); /// /// List all local backups. diff --git a/Core.Arango/Modules/IArangoCollectionModule.cs b/Core.Arango/Modules/IArangoCollectionModule.cs index 3a7c6fac92..e3c16dd4ed 100644 --- a/Core.Arango/Modules/IArangoCollectionModule.cs +++ b/Core.Arango/Modules/IArangoCollectionModule.cs @@ -13,13 +13,13 @@ public interface IArangoCollectionModule /// /// Creates a collection /// - Task CreateAsync(ArangoHandle database, ArangoCollection collection, + ValueTask CreateAsync(ArangoHandle database, ArangoCollection collection, CancellationToken cancellationToken = default); /// /// Creates a collection /// - Task CreateAsync(ArangoHandle database, string collection, ArangoCollectionType type, + ValueTask CreateAsync(ArangoHandle database, string collection, ArangoCollectionType type, CancellationToken cancellationToken = default); /// @@ -31,25 +31,25 @@ ValueTask> ListAsync(ArangoHandle database /// /// Renames a collection (not in cluster) /// - Task RenameAsync(ArangoHandle database, string oldname, string newname, + ValueTask RenameAsync(ArangoHandle database, string oldname, string newname, CancellationToken cancellationToken = default); /// /// Truncates a collection /// - Task TruncateAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); + ValueTask TruncateAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); /// /// Changes a collection /// - Task UpdateAsync(ArangoHandle database, string collection, ArangoCollectionUpdate update, + ValueTask UpdateAsync(ArangoHandle database, string collection, ArangoCollectionUpdate update, CancellationToken cancellationToken = default); /// /// Drops a collection /// /// - Task DropAsync(ArangoHandle database, string collection, + ValueTask DropAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); /// @@ -67,13 +67,13 @@ ValueTask ExistAsync(ArangoHandle database, string collection, /// /// Compacts the data of a collection in order to reclaim disk space /// - Task CompactAsync(ArangoHandle database, string collection, + ValueTask CompactAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); /// /// Recalculates the document count of a collection, if it ever becomes inconsistent. /// - Task RecalculateCountAsync(ArangoHandle database, string collection, + ValueTask RecalculateCountAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoDatabaseModule.cs b/Core.Arango/Modules/IArangoDatabaseModule.cs index 19615bdeb4..209ede9621 100644 --- a/Core.Arango/Modules/IArangoDatabaseModule.cs +++ b/Core.Arango/Modules/IArangoDatabaseModule.cs @@ -28,7 +28,7 @@ public interface IArangoDatabaseModule /// /// Drop an existing database /// - Task DropAsync(ArangoHandle name, CancellationToken cancellationToken = default); + ValueTask DropAsync(ArangoHandle name, CancellationToken cancellationToken = default); /// /// Checks if database exists diff --git a/Core.Arango/Modules/IArangoDocumentModule.cs b/Core.Arango/Modules/IArangoDocumentModule.cs index 965d7be997..409fe3d4f6 100644 --- a/Core.Arango/Modules/IArangoDocumentModule.cs +++ b/Core.Arango/Modules/IArangoDocumentModule.cs @@ -137,7 +137,7 @@ IAsyncEnumerable> ExportAsync(ArangoHandle database, string collectio /// /// Bulk import /// - Task ImportAsync(ArangoHandle database, string collection, IEnumerable docs, bool complete = true, + ValueTask ImportAsync(ArangoHandle database, string collection, IEnumerable docs, bool complete = true, CancellationToken cancellationToken = default); /// diff --git a/Core.Arango/Modules/IArangoFoxxModule.cs b/Core.Arango/Modules/IArangoFoxxModule.cs index e343218efc..a47a4f88c4 100644 --- a/Core.Arango/Modules/IArangoFoxxModule.cs +++ b/Core.Arango/Modules/IArangoFoxxModule.cs @@ -157,7 +157,7 @@ ValueTask DeleteAsync(ArangoHandle database, string path, /// Mount path of the installed service. /// /// - Task EnableDevelopmentModeAsync(ArangoHandle database, string mount, + ValueTask EnableDevelopmentModeAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default); /// @@ -167,7 +167,7 @@ Task EnableDevelopmentModeAsync(ArangoHandle database, string mount, /// Mount path of the installed service. /// /// - Task DisableDevelopmentModeAsync(ArangoHandle database, string mount, + ValueTask DisableDevelopmentModeAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default); /// diff --git a/Core.Arango/Modules/IArangoGraphModule.cs b/Core.Arango/Modules/IArangoGraphModule.cs index 7b579ed4cd..188d073a40 100644 --- a/Core.Arango/Modules/IArangoGraphModule.cs +++ b/Core.Arango/Modules/IArangoGraphModule.cs @@ -23,12 +23,12 @@ public interface IArangoGraphModule /// /// Create a new graph in the graph module. /// - Task CreateAsync(ArangoHandle database, ArangoGraph request, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoHandle database, ArangoGraph request, CancellationToken cancellationToken = default); /// /// Delete an existing graph. /// - Task DropAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default); + ValueTask DropAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default); /// /// Lists all graphs known to the graph module. @@ -44,19 +44,19 @@ ValueTask> ListAsync(ArangoHandle database, /// /// Add an additional vertex collection to the graph. /// - Task AddVertexCollectionAsync(ArangoHandle database, string graph, ArangoVertexCollection vertexCollection, + ValueTask AddVertexCollectionAsync(ArangoHandle database, string graph, ArangoVertexCollection vertexCollection, CancellationToken cancellationToken = default); /// /// Add a new edge definition to the graph /// - Task AddEdgeDefinitionAsync(ArangoHandle database, string graph, ArangoEdgeDefinition edgeDefinition, + ValueTask AddEdgeDefinitionAsync(ArangoHandle database, string graph, ArangoEdgeDefinition edgeDefinition, CancellationToken cancellationToken = default); /// /// Remove a vertex collection form the graph. /// - Task RemoveVertexCollectionAsync(ArangoHandle database, string graph, string vertexCollection, + ValueTask RemoveVertexCollectionAsync(ArangoHandle database, string graph, string vertexCollection, bool? dropCollection = null, CancellationToken cancellationToken = default); @@ -64,14 +64,14 @@ Task RemoveVertexCollectionAsync(ArangoHandle database, string graph, string ver /// Replace an existing edge definition /// /// - Task ReplaceEdgeDefinitionAsync(ArangoHandle database, string graph, ArangoEdgeDefinition edgeDefinition, + ValueTask ReplaceEdgeDefinitionAsync(ArangoHandle database, string graph, ArangoEdgeDefinition edgeDefinition, bool? dropCollections = null, CancellationToken cancellationToken = default); /// /// Remove an edge definition form the graph /// - Task RemoveEdgeDefinitionAsync(ArangoHandle database, string graph, string edgeDefinition, + ValueTask RemoveEdgeDefinitionAsync(ArangoHandle database, string graph, string edgeDefinition, bool? dropCollections = null, CancellationToken cancellationToken = default); } diff --git a/Core.Arango/Modules/IArangoIndexModule.cs b/Core.Arango/Modules/IArangoIndexModule.cs index 0452d0ef77..ba1458df85 100644 --- a/Core.Arango/Modules/IArangoIndexModule.cs +++ b/Core.Arango/Modules/IArangoIndexModule.cs @@ -13,18 +13,18 @@ public interface IArangoIndexModule /// /// creates an index /// - Task CreateAsync(ArangoHandle database, string collection, ArangoIndex request, + ValueTask CreateAsync(ArangoHandle database, string collection, ArangoIndex request, CancellationToken cancellationToken = default); /// /// Drops all indices of a database /// - Task DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default); + ValueTask DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// /// Drops an index /// - Task DropAsync(ArangoHandle database, string index, CancellationToken cancellationToken = default); + ValueTask DropAsync(ArangoHandle database, string index, CancellationToken cancellationToken = default); /// /// Returns all indexes of a collection diff --git a/Core.Arango/Modules/IArangoPregelModule.cs b/Core.Arango/Modules/IArangoPregelModule.cs index 907173ea7a..ae093cd028 100644 --- a/Core.Arango/Modules/IArangoPregelModule.cs +++ b/Core.Arango/Modules/IArangoPregelModule.cs @@ -24,6 +24,6 @@ ValueTask GetJobStatusAsync(ArangoHandle database, string id /// /// Cancel an ongoing Pregel execution /// - Task DeleteJobAsync(ArangoHandle database, string id, CancellationToken cancellationToken = default); + ValueTask DeleteJobAsync(ArangoHandle database, string id, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/Core.Arango/Modules/IArangoTransactionModule.cs b/Core.Arango/Modules/IArangoTransactionModule.cs index ca5b47560c..3612bea73d 100644 --- a/Core.Arango/Modules/IArangoTransactionModule.cs +++ b/Core.Arango/Modules/IArangoTransactionModule.cs @@ -18,12 +18,12 @@ ValueTask BeginAsync(ArangoHandle database, ArangoTransaction requ /// /// Abort a server-side transaction /// - Task AbortAsync(ArangoHandle database, CancellationToken cancellationToken = default); + ValueTask AbortAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// /// Commit a server-side transaction /// - Task CommitAsync(ArangoHandle database, CancellationToken cancellationToken = default); + ValueTask CommitAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// /// execute a server-side (script) transaction diff --git a/Core.Arango/Modules/IArangoViewModule.cs b/Core.Arango/Modules/IArangoViewModule.cs index fb1453fe76..003cb76a80 100644 --- a/Core.Arango/Modules/IArangoViewModule.cs +++ b/Core.Arango/Modules/IArangoViewModule.cs @@ -13,29 +13,29 @@ public interface IArangoViewModule /// /// creates an ArangoSearch View /// - Task CreateAsync(ArangoHandle database, ArangoView view, CancellationToken cancellationToken = default); + ValueTask CreateAsync(ArangoHandle database, ArangoView view, CancellationToken cancellationToken = default); /// /// changes all properties of an ArangoSearch View /// - Task UpdateAsync(ArangoHandle database, ArangoViewUpdate view, CancellationToken cancellationToken = default); + ValueTask UpdateAsync(ArangoHandle database, ArangoViewUpdate view, CancellationToken cancellationToken = default); /// /// partially changes properties of an ArangoSearch View /// - Task PatchAsync(ArangoHandle database, ArangoViewPatch view, CancellationToken cancellationToken = default); + ValueTask PatchAsync(ArangoHandle database, ArangoViewPatch view, CancellationToken cancellationToken = default); /// /// Drops all Views in database /// - Task DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default); + ValueTask DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default); /// /// Drops a View /// - Task DropAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default); + ValueTask DropAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default); /// /// Returns all Views diff --git a/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs b/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs index 4514fe2f6e..3b742c2de6 100644 --- a/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs +++ b/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs @@ -29,7 +29,7 @@ public async ValueTask GetDefinitionAsync(ArangoHandle database, cancellationToken: cancellationToken); } - public async Task CreateAsync(ArangoHandle database, + public async ValueTask CreateAsync(ArangoHandle database, ArangoAnalyzer analyzer, CancellationToken cancellationToken = default) { @@ -39,7 +39,7 @@ await SendAsync>(database, HttpMethod.Post, cancellationToken: cancellationToken); } - public async Task DeleteAsync(ArangoHandle database, + public async ValueTask DeleteAsync(ArangoHandle database, string analyzer, bool force = false, CancellationToken cancellationToken = default) { diff --git a/Core.Arango/Modules/Internal/ArangoBackupModule.cs b/Core.Arango/Modules/Internal/ArangoBackupModule.cs index 3db2539410..2fc147c3ee 100644 --- a/Core.Arango/Modules/Internal/ArangoBackupModule.cs +++ b/Core.Arango/Modules/Internal/ArangoBackupModule.cs @@ -23,7 +23,7 @@ public async ValueTask CreateAsync(ArangoBackupRequest request, return res.Result; } - public async Task RestoreAsync(string id, CancellationToken cancellationToken = default) + public async ValueTask RestoreAsync(string id, CancellationToken cancellationToken = default) { await SendAsync(null, HttpMethod.Post, "/_admin/backup/restore", new @@ -32,7 +32,7 @@ await SendAsync(null, HttpMethod.Post, "/_admin/backup/restore", }, cancellationToken: cancellationToken); } - public async Task DeleteAsync(string id, CancellationToken cancellationToken = default) + public async ValueTask DeleteAsync(string id, CancellationToken cancellationToken = default) { await SendAsync(null, HttpMethod.Post, "/_admin/backup/delete", new diff --git a/Core.Arango/Modules/Internal/ArangoCollectionModule.cs b/Core.Arango/Modules/Internal/ArangoCollectionModule.cs index 3ac3d4e9d9..02c921302e 100644 --- a/Core.Arango/Modules/Internal/ArangoCollectionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoCollectionModule.cs @@ -14,7 +14,7 @@ public ArangoCollectionModule(IArangoContext context) : base(context) { } - public async Task CreateAsync(ArangoHandle database, string collection, ArangoCollectionType type, + public async ValueTask CreateAsync(ArangoHandle database, string collection, ArangoCollectionType type, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Post, @@ -26,7 +26,7 @@ await SendAsync(database, HttpMethod.Post, }, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task CreateAsync(ArangoHandle database, ArangoCollection collection, + public async ValueTask CreateAsync(ArangoHandle database, ArangoCollection collection, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Post, @@ -35,7 +35,7 @@ await SendAsync(database, HttpMethod.Post, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task TruncateAsync(ArangoHandle database, string collection, + public async ValueTask TruncateAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Put, @@ -52,7 +52,7 @@ public async ValueTask> ListAsync(ArangoHa return res.Result; } - public async Task UpdateAsync(ArangoHandle database, string collection, ArangoCollectionUpdate update, + public async ValueTask UpdateAsync(ArangoHandle database, string collection, ArangoCollectionUpdate update, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Put, @@ -61,7 +61,7 @@ await SendAsync(database, HttpMethod.Put, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task RenameAsync(ArangoHandle database, string oldname, string newname, + public async ValueTask RenameAsync(ArangoHandle database, string oldname, string newname, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Put, @@ -81,7 +81,7 @@ public async ValueTask ExistAsync(ArangoHandle database, string collection return collections.Any(x => x.Name.Equals(collection)); } - public async Task CompactAsync(ArangoHandle database, string collection, + public async ValueTask CompactAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { await SendAsync( @@ -90,7 +90,7 @@ await SendAsync( null, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task RecalculateCountAsync(ArangoHandle database, string collection, + public async ValueTask RecalculateCountAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { await SendAsync( @@ -108,7 +108,7 @@ public async ValueTask GetAsync(ArangoHandle database, string null, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task DropAsync(ArangoHandle database, string collection, + public async ValueTask DropAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Delete, diff --git a/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs b/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs index 8199752ea7..1add6a5e42 100644 --- a/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs +++ b/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs @@ -68,7 +68,7 @@ public async ValueTask ExistAsync(ArangoHandle handle, CancellationToken c return db != null; } - public async Task DropAsync(ArangoHandle name, CancellationToken cancellationToken = default) + public async ValueTask DropAsync(ArangoHandle name, CancellationToken cancellationToken = default) { await SendAsync(name, HttpMethod.Delete, ApiPath("_system", $"database/{RealmPrefix(name)}"), null, diff --git a/Core.Arango/Modules/Internal/ArangoDocumentModule.cs b/Core.Arango/Modules/Internal/ArangoDocumentModule.cs index 34a0a9bc4a..de75d06fea 100644 --- a/Core.Arango/Modules/Internal/ArangoDocumentModule.cs +++ b/Core.Arango/Modules/Internal/ArangoDocumentModule.cs @@ -123,7 +123,7 @@ public async ValueTask> CreateAsync(ArangoHand return res?.SingleOrDefault(); } - public async Task ImportAsync(ArangoHandle database, string collection, IEnumerable docs, + public async ValueTask ImportAsync(ArangoHandle database, string collection, IEnumerable docs, bool complete = true, CancellationToken cancellationToken = default) { diff --git a/Core.Arango/Modules/Internal/ArangoFoxxModule.cs b/Core.Arango/Modules/Internal/ArangoFoxxModule.cs index 2c2e794a61..d26e73023d 100644 --- a/Core.Arango/Modules/Internal/ArangoFoxxModule.cs +++ b/Core.Arango/Modules/Internal/ArangoFoxxModule.cs @@ -182,7 +182,7 @@ public async ValueTask ReplaceDependenciesAsync(ArangoHandle databas cancellationToken: cancellationToken); } - public async Task EnableDevelopmentModeAsync(ArangoHandle database, string mount, + public async ValueTask EnableDevelopmentModeAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default) { var parameter = new Dictionary { { "mount", mount } }; @@ -192,7 +192,7 @@ await SendAsync(database, HttpMethod.Post, cancellationToken: cancellationToken); } - public async Task DisableDevelopmentModeAsync(ArangoHandle database, string mount, + public async ValueTask DisableDevelopmentModeAsync(ArangoHandle database, string mount, CancellationToken cancellationToken = default) { var parameter = new Dictionary { { "mount", mount } }; diff --git a/Core.Arango/Modules/Internal/ArangoGraphModule.cs b/Core.Arango/Modules/Internal/ArangoGraphModule.cs index 99408397b4..cc310c4016 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphModule.cs @@ -37,7 +37,7 @@ public async ValueTask GetAsync(ArangoHandle database, string graph public IArangoGraphVertexModule Vertex { get; } public IArangoGraphEdgeModule Edge { get; } - public async Task CreateAsync(ArangoHandle database, ArangoGraph request, + public async ValueTask CreateAsync(ArangoHandle database, ArangoGraph request, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Post, @@ -45,7 +45,7 @@ await SendAsync(database, HttpMethod.Post, request, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task AddVertexCollectionAsync(ArangoHandle database, string graph, + public async ValueTask AddVertexCollectionAsync(ArangoHandle database, string graph, ArangoVertexCollection vertexCollection, CancellationToken cancellationToken = default) { @@ -54,7 +54,7 @@ await SendAsync(database, HttpMethod.Post, vertexCollection, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task RemoveVertexCollectionAsync(ArangoHandle database, string graph, string vertexCollection, + public async ValueTask RemoveVertexCollectionAsync(ArangoHandle database, string graph, string vertexCollection, bool? dropCollection = null, CancellationToken cancellationToken = default) { @@ -68,7 +68,7 @@ await SendAsync(database, HttpMethod.Delete, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task AddEdgeDefinitionAsync(ArangoHandle database, string graph, + public async ValueTask AddEdgeDefinitionAsync(ArangoHandle database, string graph, ArangoEdgeDefinition edgeDefinition, CancellationToken cancellationToken = default) { @@ -77,7 +77,7 @@ await SendAsync(database, HttpMethod.Post, edgeDefinition, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task ReplaceEdgeDefinitionAsync(ArangoHandle database, string graph, + public async ValueTask ReplaceEdgeDefinitionAsync(ArangoHandle database, string graph, ArangoEdgeDefinition edgeDefinition, bool? dropCollections = null, CancellationToken cancellationToken = default) @@ -92,7 +92,7 @@ await SendAsync(database, HttpMethod.Put, edgeDefinition, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task RemoveEdgeDefinitionAsync(ArangoHandle database, string graph, string edgeDefinition, + public async ValueTask RemoveEdgeDefinitionAsync(ArangoHandle database, string graph, string edgeDefinition, bool? dropCollections = null, CancellationToken cancellationToken = default) { @@ -106,7 +106,7 @@ await SendAsync(database, HttpMethod.Delete, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task DropAsync(ArangoHandle database, string name, + public async ValueTask DropAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Delete, diff --git a/Core.Arango/Modules/Internal/ArangoIndexModule.cs b/Core.Arango/Modules/Internal/ArangoIndexModule.cs index 415a63f5d6..b33e35ceb9 100644 --- a/Core.Arango/Modules/Internal/ArangoIndexModule.cs +++ b/Core.Arango/Modules/Internal/ArangoIndexModule.cs @@ -15,7 +15,7 @@ internal ArangoIndexModule(IArangoContext context) : base(context) { } - public async Task CreateAsync(ArangoHandle database, string collection, ArangoIndex request, + public async ValueTask CreateAsync(ArangoHandle database, string collection, ArangoIndex request, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Post, @@ -26,7 +26,7 @@ await SendAsync(database, HttpMethod.Post, /// /// Drops all user created indices over all collections in database /// - public async Task DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default) + public async ValueTask DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default) { var collections = await Context.Collection.ListAsync(database, cancellationToken).ConfigureAwait(false); @@ -57,7 +57,7 @@ public async ValueTask> ListAsync(ArangoHandle }).ToList(); } - public async Task DropAsync(ArangoHandle database, string index, + public async ValueTask DropAsync(ArangoHandle database, string index, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Delete, diff --git a/Core.Arango/Modules/Internal/ArangoPregelModule.cs b/Core.Arango/Modules/Internal/ArangoPregelModule.cs index 112d28ad2a..552ccca96c 100644 --- a/Core.Arango/Modules/Internal/ArangoPregelModule.cs +++ b/Core.Arango/Modules/Internal/ArangoPregelModule.cs @@ -27,7 +27,7 @@ public async ValueTask GetJobStatusAsync(ArangoHandle databa cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task DeleteJobAsync(ArangoHandle database, string id, + public async ValueTask DeleteJobAsync(ArangoHandle database, string id, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Delete, diff --git a/Core.Arango/Modules/Internal/ArangoTransactionModule.cs b/Core.Arango/Modules/Internal/ArangoTransactionModule.cs index 3139e3e372..3864dc8dfb 100644 --- a/Core.Arango/Modules/Internal/ArangoTransactionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoTransactionModule.cs @@ -31,7 +31,7 @@ public async ValueTask BeginAsync(ArangoHandle database, ArangoTra return new ArangoHandle(database, transaction); } - public async Task CommitAsync(ArangoHandle database, + public async ValueTask CommitAsync(ArangoHandle database, CancellationToken cancellationToken = default) { if (string.IsNullOrWhiteSpace(database.Transaction)) @@ -42,7 +42,7 @@ await SendAsync(null, HttpMethod.Put, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task AbortAsync(ArangoHandle database, CancellationToken cancellationToken = default) + public async ValueTask AbortAsync(ArangoHandle database, CancellationToken cancellationToken = default) { if (string.IsNullOrWhiteSpace(database.Transaction)) throw new ArangoException("no transaction handle"); diff --git a/Core.Arango/Modules/Internal/ArangoViewModule.cs b/Core.Arango/Modules/Internal/ArangoViewModule.cs index f5a16537e6..d946693ac2 100644 --- a/Core.Arango/Modules/Internal/ArangoViewModule.cs +++ b/Core.Arango/Modules/Internal/ArangoViewModule.cs @@ -13,7 +13,7 @@ internal ArangoViewModule(IArangoContext context) : base(context) { } - public async Task CreateAsync(ArangoHandle database, ArangoView view, + public async ValueTask CreateAsync(ArangoHandle database, ArangoView view, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Post, @@ -22,7 +22,7 @@ await SendAsync(database, HttpMethod.Post, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task UpdateAsync(ArangoHandle database, ArangoViewUpdate view, CancellationToken cancellationToken = default) + public async ValueTask UpdateAsync(ArangoHandle database, ArangoViewUpdate view, CancellationToken cancellationToken = default) { await SendAsync(database, HttpMethod.Put, ApiPath(database, $"view/{UrlEncode(view.Name)}/properties"), @@ -30,7 +30,7 @@ await SendAsync(database, HttpMethod.Put, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task PatchAsync(ArangoHandle database, ArangoViewPatch view, CancellationToken cancellationToken = default) + public async ValueTask PatchAsync(ArangoHandle database, ArangoViewPatch view, CancellationToken cancellationToken = default) { await SendAsync(database, PolyfillHelper.Patch, ApiPath(database, $"view/{UrlEncode(view.Name)}/properties"), @@ -56,7 +56,7 @@ public async ValueTask GetPropertiesAsync(ArangoHandle database, str return res; } - public async Task DropAsync(ArangoHandle database, + public async ValueTask DropAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default) { @@ -65,7 +65,7 @@ await SendAsync(database, HttpMethod.Delete, cancellationToken: cancellationToken).ConfigureAwait(false); } - public async Task DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default) + public async ValueTask DropAllAsync(ArangoHandle database, CancellationToken cancellationToken = default) { var views = await ListAsync(database, cancellationToken).ConfigureAwait(false); diff --git a/Core.Arango/Transport/ArangoHttpTransport.cs b/Core.Arango/Transport/ArangoHttpTransport.cs index b363826a77..134599c33f 100644 --- a/Core.Arango/Transport/ArangoHttpTransport.cs +++ b/Core.Arango/Transport/ArangoHttpTransport.cs @@ -170,7 +170,7 @@ private void ApplyHeaders(string transaction, bool auth, HttpRequestMessage msg, msg.Headers.Add(header.Key, header.Value); } - private async Task Authenticate(bool auth, CancellationToken cancellationToken) + private async ValueTask Authenticate(bool auth, CancellationToken cancellationToken) { if (string.IsNullOrWhiteSpace(_configuration.User)) return; From 216de0b82c334754328fe396bdea3c1ec857ae0b Mon Sep 17 00:00:00 2001 From: Harry Cordewener Date: Sat, 16 Nov 2024 11:36:38 -0600 Subject: [PATCH 3/4] Fix build. --- Core.Arango.Tests/AnalyzerViewTest.cs | 2 +- Core.Arango.Tests/BackupTest.cs | 2 +- Core.Arango.Tests/CamelCaseTest.cs | 2 +- Core.Arango.Tests/CollectionTest.cs | 6 +- Core.Arango.Tests/Core/TestBase.cs | 6 +- Core.Arango.Tests/DatabaseTest.cs | 4 +- Core.Arango.Tests/DocumentTest.cs | 22 +++--- Core.Arango.Tests/FoxxTest.cs | 6 +- Core.Arango.Tests/FunctionTest.cs | 2 +- Core.Arango.Tests/GraphTest.cs | 6 +- Core.Arango.Tests/IndexTest.cs | 2 +- Core.Arango.Tests/LinqTest.cs | 40 +++++----- Core.Arango.Tests/LinqTest_BasicOperations.cs | 73 +++++++++---------- Core.Arango.Tests/LinqTest_String.cs | 44 +++++------ Core.Arango.Tests/QueryFormattingTest.cs | 4 +- Core.Arango.Tests/QueryStatisticTest.cs | 15 +--- Core.Arango.Tests/QueryTest.cs | 16 ++-- Core.Arango.Tests/TransactionTest.cs | 8 +- Core.Arango/Core.Arango.xml | 8 +- 19 files changed, 123 insertions(+), 145 deletions(-) diff --git a/Core.Arango.Tests/AnalyzerViewTest.cs b/Core.Arango.Tests/AnalyzerViewTest.cs index cca4aed58b..0cd53040fc 100644 --- a/Core.Arango.Tests/AnalyzerViewTest.cs +++ b/Core.Arango.Tests/AnalyzerViewTest.cs @@ -10,7 +10,7 @@ public class AnalyzerViewTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask AnalyzersViews(string serializer) + public async Task AnalyzersViews(string serializer) { await SetupAsync(serializer); diff --git a/Core.Arango.Tests/BackupTest.cs b/Core.Arango.Tests/BackupTest.cs index 2d21e77514..7eae31835a 100644 --- a/Core.Arango.Tests/BackupTest.cs +++ b/Core.Arango.Tests/BackupTest.cs @@ -3,7 +3,7 @@ namespace Core.Arango.Tests /*public class BackupTest : TestBase { [Fact] - public async ValueTask BackupRestoreDelete() + public async Task BackupRestoreDelete() { await SetupAsync("system-camel"); diff --git a/Core.Arango.Tests/CamelCaseTest.cs b/Core.Arango.Tests/CamelCaseTest.cs index 2ac8dd51c4..84d46470ca 100644 --- a/Core.Arango.Tests/CamelCaseTest.cs +++ b/Core.Arango.Tests/CamelCaseTest.cs @@ -10,7 +10,7 @@ public class CamelCaseTest : TestBase { [Theory] [ClassData(typeof(CamelCaseData))] - public async ValueTask GetCamelCase(string serializer) + public async Task GetCamelCase(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/CollectionTest.cs b/Core.Arango.Tests/CollectionTest.cs index aad6e8cff2..862f23f395 100644 --- a/Core.Arango.Tests/CollectionTest.cs +++ b/Core.Arango.Tests/CollectionTest.cs @@ -18,7 +18,7 @@ public CollectionTest(ITestOutputHelper output) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Create(string serializer) + public async Task Create(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", new ArangoCollection @@ -40,7 +40,7 @@ public async ValueTask Create(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CreateExistGetDrop(string serializer) + public async Task CreateExistGetDrop(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", new ArangoCollection @@ -63,7 +63,7 @@ public async ValueTask CreateExistGetDrop(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Schema(string serializer) + public async Task Schema(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) diff --git a/Core.Arango.Tests/Core/TestBase.cs b/Core.Arango.Tests/Core/TestBase.cs index d55f3937b5..db9ee489f8 100644 --- a/Core.Arango.Tests/Core/TestBase.cs +++ b/Core.Arango.Tests/Core/TestBase.cs @@ -14,12 +14,12 @@ public abstract class TestBase : IAsyncLifetime { public IArangoContext Arango { get; protected set; } - public virtual ValueTask InitializeAsync() + public virtual Task InitializeAsync() { return Task.CompletedTask; } - public async ValueTask DisposeAsync() + public async Task DisposeAsync() { try { @@ -32,7 +32,7 @@ public async ValueTask DisposeAsync() } } - public async ValueTask SetupAsync(string serializer, string createDatabase = "test") + public async Task SetupAsync(string serializer, string createDatabase = "test") { Arango = new ArangoContext(UniqueTestRealm(), new ArangoConfiguration { diff --git a/Core.Arango.Tests/DatabaseTest.cs b/Core.Arango.Tests/DatabaseTest.cs index e03fbbdc26..5f54097318 100644 --- a/Core.Arango.Tests/DatabaseTest.cs +++ b/Core.Arango.Tests/DatabaseTest.cs @@ -18,7 +18,7 @@ public DatabaseTest(ITestOutputHelper output) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Create(string serializer) + public async Task Create(string serializer) { await SetupAsync(serializer, null); @@ -39,7 +39,7 @@ await Arango.Database.CreateAsync(new ArangoDatabase [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Drop(string serializer) + public async Task Drop(string serializer) { await SetupAsync(serializer, null); diff --git a/Core.Arango.Tests/DocumentTest.cs b/Core.Arango.Tests/DocumentTest.cs index f7c0cccf0d..5d8a65fa07 100644 --- a/Core.Arango.Tests/DocumentTest.cs +++ b/Core.Arango.Tests/DocumentTest.cs @@ -13,7 +13,7 @@ public class DocumentTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Get(string serializer) + public async Task Get(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -50,7 +50,7 @@ public async ValueTask Get(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Update(string serializer) + public async Task Update(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -88,7 +88,7 @@ public async ValueTask Update(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CreateUpdateMode(string serializer) + public async Task CreateUpdateMode(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) @@ -124,7 +124,7 @@ public async ValueTask CreateUpdateMode(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CreateReplaceMode(string serializer) + public async Task CreateReplaceMode(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) @@ -160,7 +160,7 @@ public async ValueTask CreateReplaceMode(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CreateSilent(string serializer) + public async Task CreateSilent(string serializer) { await SetupAsync(serializer); @@ -175,7 +175,7 @@ public async ValueTask CreateSilent(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CreateManySilent(string serializer) + public async Task CreateManySilent(string serializer) { await SetupAsync(serializer); @@ -198,7 +198,7 @@ public async ValueTask CreateManySilent(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask DeleteMany(string serializer) + public async Task DeleteMany(string serializer) { await SetupAsync(serializer); @@ -240,7 +240,7 @@ public async ValueTask DeleteMany(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CreateConflictMode(string serializer) + public async Task CreateConflictMode(string serializer) { await SetupAsync(serializer); if ((await Arango.GetVersionAsync()).SemanticVersion < Version.Parse("3.7")) @@ -271,7 +271,7 @@ public async ValueTask CreateConflictMode(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask OptimisticConcurrency(string serializer) + public async Task OptimisticConcurrency(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -308,7 +308,7 @@ public async ValueTask OptimisticConcurrency(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask OptimisticConcurrencyMulti(string serializer) + public async Task OptimisticConcurrencyMulti(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -354,7 +354,7 @@ public async ValueTask OptimisticConcurrencyMulti(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask GetManyTest(string serializer) + public async Task GetManyTest(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/FoxxTest.cs b/Core.Arango.Tests/FoxxTest.cs index 841977a27a..4993605b34 100644 --- a/Core.Arango.Tests/FoxxTest.cs +++ b/Core.Arango.Tests/FoxxTest.cs @@ -14,7 +14,7 @@ namespace Core.Arango.Tests public class FoxxTest : TestBase { [Fact] - public async ValueTask InstallScript() + public async Task InstallScript() { await SetupAsync("system-camel"); @@ -38,7 +38,7 @@ await Arango.Foxx.InstallServiceAsync("test", "/sample/service", ArangoFoxxSourc Assert.Equal("/sample/service", services.First().Mount); } - private async ValueTask BuildService(string response) + private async Task BuildService(string response) { var ms = new MemoryStream(); using (var zip = new ZipArchive(ms, ZipArchiveMode.Create, true, Encoding.UTF8)) @@ -101,7 +101,7 @@ await index.WriteAsync(Encoding.UTF8.GetBytes($@" } [Fact] - public async ValueTask InstallZip() + public async Task InstallZip() { await SetupAsync("system-camel"); diff --git a/Core.Arango.Tests/FunctionTest.cs b/Core.Arango.Tests/FunctionTest.cs index 08d341d5c8..d98bf0dc8a 100644 --- a/Core.Arango.Tests/FunctionTest.cs +++ b/Core.Arango.Tests/FunctionTest.cs @@ -14,7 +14,7 @@ public class FunctionTest : TestBase [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Run(string serializer) + public async Task Run(string serializer) { await SetupAsync(serializer); var function = Arango.Function; diff --git a/Core.Arango.Tests/GraphTest.cs b/Core.Arango.Tests/GraphTest.cs index 8ae859b2f1..ea0a6189bb 100644 --- a/Core.Arango.Tests/GraphTest.cs +++ b/Core.Arango.Tests/GraphTest.cs @@ -11,7 +11,7 @@ public class GraphTest : TestBase { [Theory] [ClassData(typeof(CamelCaseData))] - public async ValueTask Get(string serializer) + public async Task Get(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "vertices", ArangoCollectionType.Document); @@ -108,7 +108,7 @@ public async ValueTask Get(string serializer) [Theory] [ClassData(typeof(CamelCaseData))] - public async ValueTask TransactionalOperations(string serializer) + public async Task TransactionalOperations(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "vertices", ArangoCollectionType.Document); @@ -230,7 +230,7 @@ public async ValueTask TransactionalOperations(string serializer) [Theory] [ClassData(typeof(CamelCaseData))] - public async ValueTask ReplaceEdgeDefinition(string serializer) + public async Task ReplaceEdgeDefinition(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "vertices1", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/IndexTest.cs b/Core.Arango.Tests/IndexTest.cs index 26679cf46d..b77a83e136 100644 --- a/Core.Arango.Tests/IndexTest.cs +++ b/Core.Arango.Tests/IndexTest.cs @@ -10,7 +10,7 @@ public class IndexTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask DropAll(string serializer) + public async Task DropAll(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/LinqTest.cs b/Core.Arango.Tests/LinqTest.cs index bc164762f2..2e7fa9ccee 100644 --- a/Core.Arango.Tests/LinqTest.cs +++ b/Core.Arango.Tests/LinqTest.cs @@ -25,7 +25,7 @@ public LinqTest(ITestOutputHelper output) } [Fact] - public async ValueTask SelectDocument() + public async Task SelectDocument() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -42,7 +42,7 @@ public async ValueTask SelectDocument() } [Fact] - public async ValueTask FirstOrDefault() + public async Task FirstOrDefault() { var p = await Arango.Query("test") .FirstOrDefaultAsync(x => x.Name == "Project A"); @@ -51,7 +51,7 @@ public async ValueTask FirstOrDefault() } [Fact] - public async ValueTask SingleOrDefault() + public async Task SingleOrDefault() { var p = await Arango.Query("test") .SingleOrDefaultAsync(x => x.Name == "Project A"); @@ -60,7 +60,7 @@ public async ValueTask SingleOrDefault() } [Fact] - public async ValueTask SingleException() + public async Task SingleException() { await Assert.ThrowsAsync(async () => { @@ -70,7 +70,7 @@ await Arango.Query("test") } [Fact] - public async ValueTask MultiFilter() + public async Task MultiFilter() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -84,7 +84,7 @@ public async ValueTask MultiFilter() [Fact] - public async ValueTask FilterOrder() + public async Task FilterOrder() { var q = Arango.Query("test") .Where(x => (x.Name == "Project A" || x.Name == "Project B") && x.Budget <= 0); @@ -93,7 +93,7 @@ public async ValueTask FilterOrder() } [Fact] - public ValueTask Options() + public Task Options() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -105,7 +105,7 @@ public ValueTask Options() } [Fact] - public async ValueTask GroupBy() + public async Task GroupBy() { var q = Arango.Query("test") .GroupBy(y => y.ParentKey) @@ -121,7 +121,7 @@ public async ValueTask GroupBy() } [Fact] - public async ValueTask MathAbs() + public async Task MathAbs() { var q = Arango.Query("test") .Select(x => new @@ -136,7 +136,7 @@ public async ValueTask MathAbs() } [Fact] - public async ValueTask Ternary() + public async Task Ternary() { var q = Arango.Query("test") .Select(x => new @@ -151,7 +151,7 @@ public async ValueTask Ternary() } [Fact] - public async ValueTask Update() + public async Task Update() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -167,7 +167,7 @@ public async ValueTask Update() } [Fact] - public async ValueTask Remove() + public async Task Remove() { var q = Arango.Query("test") .Where(x => x.Name == "Project A") @@ -177,7 +177,7 @@ public async ValueTask Remove() } [Fact] - public async ValueTask Let() + public async Task Let() { var q = from p in Arango.Query("test") @@ -190,7 +190,7 @@ from p in Arango.Query("test") } [Fact] - public async ValueTask ListContains() + public async Task ListContains() { var list = new List { "CB" }.ToArray(); @@ -210,7 +210,7 @@ public async ValueTask ListContains() } [Fact] - public async ValueTask QueryableContains() + public async Task QueryableContains() { var q = Arango.Query("test") .Select(x => x.ClientKey) @@ -219,7 +219,7 @@ public async ValueTask QueryableContains() Assert.True(q); } - public override async ValueTask InitializeAsync() + public override async Task InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm()); await Arango.Database.CreateAsync(D); @@ -259,7 +259,7 @@ public override async ValueTask InitializeAsync() } [Fact] - public async ValueTask Count_SubQuery() + public async Task Count_SubQuery() { var q = Arango.Query("test") .Select(c => Arango.Query().Where(p => p.ClientKey == c.Key).Count()); @@ -272,7 +272,7 @@ public async ValueTask Count_SubQuery() } /*[Fact] - public async ValueTask Except_SubQuery() + public async Task Except_SubQuery() { var list = await Arango.Query("test") .Take(1) @@ -294,7 +294,7 @@ public async ValueTask Except_SubQuery() }*/ [Fact] - public async ValueTask StringContains() + public async Task StringContains() { var q = Arango.Query("test").Where(x => x.Name.Contains("abc")); var aql = q.ToAql().aql.Trim(); @@ -303,7 +303,7 @@ public async ValueTask StringContains() } [Fact] - public async ValueTask StringConcat() + public async Task StringConcat() { var q = Arango.Query("test").Where(x => string.Concat(x.Name, "Suffix") == "TestSuffix"); var aql = q.ToAql().aql.Trim(); diff --git a/Core.Arango.Tests/LinqTest_BasicOperations.cs b/Core.Arango.Tests/LinqTest_BasicOperations.cs index f0bf1d2975..8e96fa191c 100644 --- a/Core.Arango.Tests/LinqTest_BasicOperations.cs +++ b/Core.Arango.Tests/LinqTest_BasicOperations.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.Linq; using System.Threading.Tasks; using Core.Arango.Protocol; @@ -46,14 +44,9 @@ class InnerChain public string F { get; set; } } - public class LinqTest_BasicOperations : TestBase + public class LinqTest_BasicOperations(ITestOutputHelper output) : TestBase { private const string D = "test"; - private readonly ITestOutputHelper _output; - public LinqTest_BasicOperations(ITestOutputHelper output) - { - _output = output; - } [Fact] public void Any() @@ -64,7 +57,7 @@ public void Any() } [Fact] - public async ValueTask GroupBy() + public async Task GroupBy() { var q = Arango.Query("test") .GroupBy(x => new @@ -81,11 +74,11 @@ public async ValueTask GroupBy() var result = await q.ToListAsync(); - _output.WriteLine(q.ToAql().aql); + output.WriteLine(q.ToAql().aql); } /*[Fact] - public async ValueTask GroupJoin() + public async Task GroupJoin() { var magnus = new Person { Name = "Hedlund, Magnus", Key = "Per1" }; var terry = new Person { Name = "Adams, Terry", Key = "Per2" }; @@ -127,7 +120,7 @@ public async ValueTask GroupJoin() /*//Check the AQL being generated [Fact] - public async ValueTask Join() + public async Task Join() { var magnus = new Person { Name = "Hedlund, Magnus", Key = "Per1" }; var terry = new Person { Name = "Adams, Terry", Key = "Per2" }; @@ -187,12 +180,12 @@ public void Count_Result() } [Fact] - public async ValueTask Count_In_Filter() + public async Task Count_In_Filter() { var q = Arango.Query("test") .Where(x => x.Notes.Count() == 3); - _output.WriteLine(q.ToAql().aql); + output.WriteLine(q.ToAql().aql); var activities = await q.ToListAsync(); @@ -200,12 +193,12 @@ public async ValueTask Count_In_Filter() } [Fact] - public async ValueTask Count_In_Select() + public async Task Count_In_Select() { var q = Arango.Query("test") .Select(x => x.Notes.Count()); - _output.WriteLine(q.ToAql().aql); + output.WriteLine(q.ToAql().aql); var activitiesNotesCount = await q.ToListAsync(); @@ -223,11 +216,11 @@ public void All() } [Fact] - public async ValueTask Contains() + public async Task Contains() { var p = await Arango.Query("test").FirstOrDefaultAsync(); - _output.WriteLine(JsonConvert.SerializeObject(p)); + output.WriteLine(JsonConvert.SerializeObject(p)); var boolean = Arango.Query("test").Contains(p); // This should work: does `p` not get serialized the same way is it gets de-serialized? This operations should be inverse of each other. @@ -235,7 +228,7 @@ public async ValueTask Contains() } /*[Fact] - public async ValueTask Distinct() + public async Task Distinct() { var per1 = new Person { Name = "Person1", Key = "Per1" }; var per2 = new Person { Name = "Person1", Key = "Per2" }; @@ -255,7 +248,7 @@ public async ValueTask Distinct() }*/ /*[Fact] - public async ValueTask Except_Compare_Objects() + public async Task Except_Compare_Objects() { var list = await Arango.Query("test") .Take(2) @@ -272,7 +265,7 @@ public async ValueTask Except_Compare_Objects() }*/ [Fact] - public async ValueTask Except_Compare_Keys() + public async Task Except_Compare_Keys() { var list = await Arango.Query("test") .Take(2) @@ -283,7 +276,7 @@ public async ValueTask Except_Compare_Keys() .Select(x => x.Key) .Except(list); - PrintQuery(q, _output); + PrintQuery(q, output); var p = await q.ToListAsync(); @@ -291,14 +284,14 @@ public async ValueTask Except_Compare_Keys() } [Fact] - public async ValueTask Combine_Skip_Take() + public async Task Combine_Skip_Take() { var q = Arango.Query("test") .Skip(1) .Take(1) .Select(x => x.Key); - PrintQuery(q, _output); + PrintQuery(q, output); var p = await q.ToListAsync(); @@ -306,7 +299,7 @@ public async ValueTask Combine_Skip_Take() } /*[Fact] - public async ValueTask Intersect() + public async Task Intersect() { var list = await Arango.Query("test").Take(1).ToListAsync(); @@ -320,7 +313,7 @@ public async ValueTask Intersect() } [Fact] - public async ValueTask Intersect_With_Count() + public async Task Intersect_With_Count() { var list = await Arango.Query("test").Take(1).ToListAsync(); @@ -330,7 +323,7 @@ public async ValueTask Intersect_With_Count() }*/ [Fact] - public async ValueTask Union() + public async Task Union() { var personList1 = new List { @@ -357,8 +350,8 @@ public async ValueTask Union() var aql = q.ToAql(); - _output.WriteLine(aql.aql); - _output.WriteLine(JsonConvert.SerializeObject(aql.bindVars)); + output.WriteLine(aql.aql); + output.WriteLine(JsonConvert.SerializeObject(aql.bindVars)); var p = await q.ToListAsync(); @@ -367,7 +360,7 @@ public async ValueTask Union() /*//This test has precision issues. [Fact] - public async ValueTask Average() + public async Task Average() { var expectedAverage = (new List { 3.4m, 4.4m }).AsQueryable().Average(); var average = Arango.Query("test").Where(x => x.Key == "AA" || x.Key == "AB").Select(x => x.Revenue).Average(); @@ -376,7 +369,7 @@ public async ValueTask Average() }*/ [Fact] - public async ValueTask Min() + public async Task Min() { var min = Arango.Query("test").Select(x => x.Revenue).Min(); @@ -384,7 +377,7 @@ public async ValueTask Min() } [Fact] - public async ValueTask Max() + public async Task Max() { var max = Arango.Query("test").Select(x => x.Revenue).Max(); @@ -392,7 +385,7 @@ public async ValueTask Max() } [Fact] - public async ValueTask Sum() + public async Task Sum() { var expectedSum = (4.4m * 4) + 3.4m; var sum = Arango.Query("test").Select(x => x.Revenue).Sum(); @@ -401,7 +394,7 @@ public async ValueTask Sum() } /*[Fact] - public async ValueTask SameVariableChained() + public async Task SameVariableChained() { var chainTest = new OutterChain() { @@ -444,7 +437,7 @@ public async ValueTask SameVariableChained() }*/ /*[Fact] - public async ValueTask Cast() + public async Task Cast() { Person per1 = new Person { Name = "Person1", Key = "Per1" }; Person per2 = new Person { Name = "Person1", Key = "Per2" }; @@ -462,35 +455,35 @@ public async ValueTask Cast() }*/ /*[Fact] - public async ValueTask Last() + public async Task Last() { var a = Arango.Query("test").LastOrDefault(); Assert.Equal("AE", a.Key); } [Fact] - public async ValueTask Reverse() + public async Task Reverse() { var a = await Arango.Query("test").Reverse().FirstOrDefaultAsync(); Assert.Equal("AE", a.Key); }*/ [Fact] - public async ValueTask Single() + public async Task Single() { var a = await Arango.Query("test").Where(x => x.Key == "AA").SingleOrDefaultAsync(); Assert.Equal("AA", a.Key); } [Fact] - public async ValueTask Take() + public async Task Take() { var a = await Arango.Query("test").Take(2).ToListAsync(); Assert.Equal("AA", a[0].Key); Assert.Equal("AB", a[1].Key); } - public override async ValueTask InitializeAsync() + public override async Task InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm()); await Arango.Database.CreateAsync(D); diff --git a/Core.Arango.Tests/LinqTest_String.cs b/Core.Arango.Tests/LinqTest_String.cs index e677c69372..bf2ebd3edc 100644 --- a/Core.Arango.Tests/LinqTest_String.cs +++ b/Core.Arango.Tests/LinqTest_String.cs @@ -1,29 +1,21 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.Linq; using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Linq; using Core.Arango.Tests.Core; -using Newtonsoft.Json; using Xunit; using Xunit.Abstractions; namespace Core.Arango.Tests { - public class LinqTest_String : TestBase + public class LinqTest_String(ITestOutputHelper output) : TestBase { private const string D = "test"; - private readonly ITestOutputHelper _output; - public LinqTest_String(ITestOutputHelper output) - { - _output = output; - } [Fact] - public async ValueTask StringConcat() + public async Task StringConcat() { var q = Arango.Query("test").Where(x => String.Concat(x.Name, " 10") == "Project A 10"); var p = await q.FirstOrDefaultAsync(); @@ -33,7 +25,7 @@ public async ValueTask StringConcat() } [Fact] - public async ValueTask StringContains() + public async Task StringContains() { var q = Arango.Query("test").Where(x => x.Name.Contains("A")); var p = await q.FirstOrDefaultAsync(); @@ -44,7 +36,7 @@ public async ValueTask StringContains() /*//Not working at the moment. Check the comment on the second Assert. [Fact] - public async ValueTask StringTrim() + public async Task StringTrim() { await Arango.Document.CreateManyAsync(D, nameof(Project), new List { @@ -80,7 +72,7 @@ public async ValueTask StringTrim() }*/ [Fact] - public async ValueTask StringTrimStart() + public async Task StringTrimStart() { await Arango.Document.CreateManyAsync(D, nameof(Project), new List { @@ -114,7 +106,7 @@ public async ValueTask StringTrimStart() } [Fact] - public async ValueTask StringTrimEnd() + public async Task StringTrimEnd() { await Arango.Document.CreateManyAsync(D, nameof(Project), new List { @@ -148,7 +140,7 @@ public async ValueTask StringTrimEnd() } [Fact] - public async ValueTask StringLen() + public async Task StringLen() { var q = Arango.Query("test").Where(x => x.Name.Length == "Project A".Length); var p = await q.FirstOrDefaultAsync(); @@ -158,7 +150,7 @@ public async ValueTask StringLen() } [Fact] - public async ValueTask StringIndexOf() + public async Task StringIndexOf() { var q = Arango.Query("test").Where(x => x.Name.IndexOf("A") == "Project A".IndexOf("A")); var p = await q.FirstOrDefaultAsync(); @@ -168,7 +160,7 @@ public async ValueTask StringIndexOf() } [Fact] - public async ValueTask StringSplit() + public async Task StringSplit() { char[] splitChars = { ' ' }; @@ -180,7 +172,7 @@ public async ValueTask StringSplit() } [Fact] - public async ValueTask StringReplace() + public async Task StringReplace() { var q = Arango.Query("test").Where(x => x.Name.Replace('A', 'C') == "Project C"); var p = await q.FirstOrDefaultAsync(); @@ -190,7 +182,7 @@ public async ValueTask StringReplace() } [Fact] - public async ValueTask StringSubstring() + public async Task StringSubstring() { var q1 = Arango.Query("test").Where(x => x.Name.Substring(8) == "A"); var q2 = Arango.Query("test").Where(x => x.Name.Substring(1, 8) == "roject A"); @@ -201,31 +193,31 @@ public async ValueTask StringSubstring() Assert.Equal("Project A", p1.Name); Assert.Equal("Project A", p2.Name); - _output.WriteLine(q1.ToAql().aql); - _output.WriteLine(q2.ToAql().aql); + output.WriteLine(q1.ToAql().aql); + output.WriteLine(q2.ToAql().aql); } [Fact] - public async ValueTask StringToLower() + public async Task StringToLower() { var q = Arango.Query("test").Where(x => x.Name.ToLower() == "project a"); var p = await q.FirstOrDefaultAsync(); Assert.Equal("Project A", p.Name); - _output.WriteLine(q.ToAql().aql); + output.WriteLine(q.ToAql().aql); } [Fact] - public async ValueTask StringToUpper() + public async Task StringToUpper() { var q = Arango.Query("test").Where(x => x.Name.ToUpper() == "PROJECT A"); var p = await q.FirstOrDefaultAsync(); Assert.Equal("Project A", p.Name); - _output.WriteLine(q.ToAql().aql); + output.WriteLine(q.ToAql().aql); } - public override async ValueTask InitializeAsync() + public override async Task InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm()); await Arango.Database.CreateAsync(D); diff --git a/Core.Arango.Tests/QueryFormattingTest.cs b/Core.Arango.Tests/QueryFormattingTest.cs index 2c90a86739..be1772281f 100644 --- a/Core.Arango.Tests/QueryFormattingTest.cs +++ b/Core.Arango.Tests/QueryFormattingTest.cs @@ -11,7 +11,7 @@ public class QueryFormattingTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask GuidFormat(string serializer) + public async Task GuidFormat(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -25,7 +25,7 @@ public async ValueTask GuidFormat(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask DateTimeFormat(string serializer) + public async Task DateTimeFormat(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/QueryStatisticTest.cs b/Core.Arango.Tests/QueryStatisticTest.cs index 29704e5acd..2a1c0f75bb 100644 --- a/Core.Arango.Tests/QueryStatisticTest.cs +++ b/Core.Arango.Tests/QueryStatisticTest.cs @@ -9,16 +9,9 @@ namespace Core.Arango.Tests { - public class QueryStatisticTest : TestBase + public class QueryStatisticTest(ITestOutputHelper output) : TestBase { - private readonly ITestOutputHelper _output; - - public QueryStatisticTest(ITestOutputHelper output) - { - _output = output; - } - - public override async ValueTask InitializeAsync() + public override async Task InitializeAsync() { Arango = new ArangoContext(UniqueTestRealm(), @@ -31,7 +24,7 @@ public override async ValueTask InitializeAsync() foreach (var p in bindVars.OrderByDescending(x => x.Key.Length)) boundQuery = boundQuery.Replace("@" + p.Key, JsonConvert.SerializeObject(p.Value)); - _output.WriteLine( + output.WriteLine( $"{boundQuery}\n{JsonConvert.SerializeObject(stats, Formatting.Indented)}"); } }); @@ -39,7 +32,7 @@ public override async ValueTask InitializeAsync() } [Fact] - public async ValueTask QueryStats() + public async Task QueryStats() { await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/QueryTest.cs b/Core.Arango.Tests/QueryTest.cs index 3d410e5779..ede41e576e 100644 --- a/Core.Arango.Tests/QueryTest.cs +++ b/Core.Arango.Tests/QueryTest.cs @@ -21,7 +21,7 @@ public QueryTest(ITestOutputHelper output) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask NullParameter(string serializer) + public async Task NullParameter(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -43,7 +43,7 @@ public async ValueTask NullParameter(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask QueryIntegerContains(string serializer) + public async Task QueryIntegerContains(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -64,7 +64,7 @@ public async ValueTask QueryIntegerContains(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask CollectionNameParameter(string serializer) + public async Task CollectionNameParameter(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -86,7 +86,7 @@ public async ValueTask CollectionNameParameter(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask InlineFormattable(string serializer) + public async Task InlineFormattable(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -111,7 +111,7 @@ public async ValueTask InlineFormattable(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Batch(string serializer) + public async Task Batch(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -128,7 +128,7 @@ await Arango.Document.CreateManyAsync("test", "test", [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask BatchStream(string serializer) + public async Task BatchStream(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -148,7 +148,7 @@ await Arango.Document.CreateManyAsync("test", "test", [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Explain(string serializer) + public async Task Explain(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -169,7 +169,7 @@ public async ValueTask Explain(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask Parse(string serializer) + public async Task Parse(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); diff --git a/Core.Arango.Tests/TransactionTest.cs b/Core.Arango.Tests/TransactionTest.cs index ecac54709c..f1523cf2b3 100644 --- a/Core.Arango.Tests/TransactionTest.cs +++ b/Core.Arango.Tests/TransactionTest.cs @@ -13,7 +13,7 @@ public class TransactionTest : TestBase { [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask StreamTransaction(string serializer) + public async Task StreamTransaction(string serializer) { await SetupAsync(serializer); await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); @@ -62,7 +62,7 @@ public async ValueTask StreamTransaction(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask StreamTransactionQuery(string serializer) + public async Task StreamTransactionQuery(string serializer) { var documents = new List { @@ -120,9 +120,9 @@ public async ValueTask StreamTransactionQuery(string serializer) [Theory] [ClassData(typeof(PascalCaseData))] - public async ValueTask StreamTransactionBatchStreamQuery(string serializer) + public async Task StreamTransactionBatchStreamQuery(string serializer) { - async ValueTask AssertStreamQuery(ArangoHandle handle, int expected) + async Task AssertStreamQuery(ArangoHandle handle, int expected) { var i = 0; diff --git a/Core.Arango/Core.Arango.xml b/Core.Arango/Core.Arango.xml index d76a6a765f..4dcebc5bbb 100644 --- a/Core.Arango/Core.Arango.xml +++ b/Core.Arango/Core.Arango.xml @@ -935,13 +935,13 @@ cant distinguish a valid mode for provided LDAP configuration - Will be raised when a ValueTask is created with an invalid id. + Will be raised when a task is created with an invalid id. - Will be raised when a ValueTask id is created with a duplicate id. + Will be raised when a task id is created with a duplicate id. - Will be raised when a ValueTask with the specified id could not be found. + Will be raised when a task with the specified id could not be found. Will be raised when an invalid name is passed to the server. @@ -5775,7 +5775,7 @@ - For example, consider the ValueTask of determining the value of a specific query source [s] from an input value + For example, consider the task of determining the value of a specific query source [s] from an input value corresponding to a complex expression. This will return a able to perform this task. From b2f7db862b829d2b26afadd1e640f661eaaedfbb Mon Sep 17 00:00:00 2001 From: Harry Cordewener Date: Sat, 16 Nov 2024 11:38:44 -0600 Subject: [PATCH 4/4] Revert "Auxiliary commit to revert individual files from c9f13c9d76774dbf3dd650718b58ad6926e1e413" This reverts commit 784c94d4c41e44a50b43c466758eedf2106aba80. --- Core.Arango.Tests/FoxxTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core.Arango.Tests/FoxxTest.cs b/Core.Arango.Tests/FoxxTest.cs index 4993605b34..3b8fd1c2f3 100644 --- a/Core.Arango.Tests/FoxxTest.cs +++ b/Core.Arango.Tests/FoxxTest.cs @@ -110,7 +110,7 @@ await Arango.Foxx.InstallServiceAsync("test", "/sample/service", await Arango.Foxx.ReplaceConfigurationAsync("test", "/sample/service", new { - currency = "�", + currency = "€", secretKey = "s3cr3t" });