coronabytes / dotnet-arangodb

.NET Driver for ArangoDB
Apache License 2.0
66 stars 18 forks source link

ArangoCollectionModule Fix and Enhancements #8

Closed clintmorgan closed 4 years ago

clintmorgan commented 4 years ago
        public async Task<bool> ExistAsync(ArangoHandle database, string collection,
            CancellationToken cancellationToken = default)
        {
            var collections = await ListAsync(database, cancellationToken);

            return collections.Contains(collection);
        }

        public async Task<ArangoCollection> GetAsync(ArangoHandle database, string collection,
            CancellationToken cancellationToken = default)
        {
            return await SendAsync<ArangoCollection>(
                HttpMethod.Get, 
                ApiPath(database, $"collection/{UrlEncode(collection)}"),
                null, database.Transaction, cancellationToken: cancellationToken);
        }