The Couchbase .NET client allows applications to connect to Couchbase Server using any Common Language Runtime (CLR) language, including C#, F#, and VB.NET. The SDK 3.0 version is a complete rewrite of the 2.x API, providing a simpler surface area and adding support for future Couchbase Server features like Collections and Scopes.
The official Language Integrated Query (LINQ) provider for querying Couchbase Server with N1QL using the Couchbase .NET SDK. The goal of Linq2Couchbase is to create a lightweight ORM/ODM for querying Couchbase Buckets using LINQ as the lingua-franca between your application and Couchbase Server using N1QL, a SQL-like query language for JSON documents.
Couchbase GeoSearch with ASP.NET Core Ahmet Küçükoğlu shows how to use Couchbase's Full Text Search engine to create an ASP.NET Core API to find events based on location proximity.
ASP.NET Core Microservices Building a good microservice architecture is complex. These posts will help get you started with building a service and deploying it to Azure.
Introducing the Couchbase .NET SDK 3.0 "Alpha" Releases The Couchbase .NET SDK 3.0 is no longer in Alpha, but this blog post contains important background on the breaking changes between 2.x and 3.x.
Connect to Couchbase from your .NET application
Add the Couchbase .NET SDK to your project
PM> Install-Package CouchbaseNetClient
Insert data
await _bucket.InsertAsync(
"key", new {foo = "bar"}
);
Retrieve data
var result =
await _bucket.GetAsync("key");
Query with SQL
var result = await _bucket.QueryAsync(
"SELECT b.* FROM mybucket"
);
Full quick start example:
Install and Start Using the .NET SDK with Couchbase Server
Write Linq (to generate N1QL) using Linq2Couchbase:
Add Linq2Couchbase to your project
PM> Install-Package Linq2Couchbase
Create a BucketContext object
var context = new BucketContext(bucket);
Start writing Linq
var beers = from b in
_context.Query<Beer>()
where b.Name == "Weizen"
select b;
Full quick start example:
.NET Core with Linq2Couchbase First Query
Integrate Couchbase with your ASP.NET Core project using Couchbase.Extensions.DependencyInjection
Add the library to your project
PM> Install-Package Couchbase.Extensions.DependencyInjection
In ConfigureServices, add Couchbase to the services collection (in Startup.cs)
services.AddCouchbase(
Configuration.GetSection("Couchbase")
);
Inject an IBucketProvider wherever you need it:
public MyController(IBucketProvider bucketProvider)
{
_bucket = bucketProvider.GetBucket("travel-sample");
}
Full quick start example:
ASP.NET Core First Query
Ask your question on Stack Overflow (use the "couchbase
" tag)
Use your expertise to browse and answer otherCouchbase questions
Tweet your questions or comments on Twitter.
Use hashtag #couchbase
to make sure we see you!
Chat with SDK engineers and other SDK users on Gitter.
Ask your question on the Couchbase .NET SDK forum