using System.Threading.Tasks; using Couchbase; using Couchbase.Management.Collections; using Microsoft.Extensions.Logging; using NLog; using NLog.Extensions.Logging; namespace ForumQuestions { class Program { static async Task Main(string[] args) { ILoggerFactory loggerFactory = new LoggerFactory(); loggerFactory.AddNLog(new NLogProviderOptions { CaptureMessageTemplates = true, CaptureMessageProperties = true }); LogManager.LoadConfiguration("nlog.config"); var options = new ClusterOptions() { Logging = loggerFactory, UserName = "Administrator", Password = "password", ConnectionString = "couchbase://localhost" }; var cluster = await Cluster.ConnectAsync(options); var bucket = await cluster.BucketAsync("mybucket"); var collManager = bucket.Collections; var scopeSpec = new ScopeSpec("MyScope"); await collManager.CreateScopeAsync(scopeSpec); var scope = bucket.Scope("MyScope"); await cluster.DisposeAsync(); } } }