コード例 #1
0
        private static async Task SetupInitialDocuments()
        {
            var confExists = await _coll.ExistsAsync("dataLove2021");

            if (confExists.Exists)
            {
                return;
            }
            var confActivitiesExists = await _coll.ExistsAsync("dataLove2021::activities");

            if (confActivitiesExists.Exists)
            {
                return;
            }

            await _coll.InsertAsync("dataLove2021", new Conference
            {
                Name     = "Data Love 2021",
                Location = "https://datalove.konfy.care/"
            });

            await _coll.InsertAsync("dataLove2021::activities", new ConferenceActivities
            {
                ConferenceId = "dataLove2021",
                Events       = new List <ConferenceEvent>()
            });
        }
コード例 #2
0
        /// <inheritdoc/>
        public async Task <bool> IsLockedAsync(string resource)
        {
            var existsResult = await _couchbaseCollection.ExistsAsync(resource)
                               .ConfigureAwait(false);

            return(existsResult.Exists);
        }
コード例 #3
0
        public static Task <IExistsResult> ExistsAsync(this ICouchbaseCollection collection, string id,
                                                       Action <ExistsOptions> configureOptions)
        {
            var options = new ExistsOptions();

            configureOptions?.Invoke(options);

            return(collection.ExistsAsync(id, options));
        }
コード例 #4
0
 public static Task <IExistsResult> ExistsAsync(this ICouchbaseCollection collection, string id)
 {
     return(collection.ExistsAsync(id, ExistsOptions.Default));
 }