Back to the Couchbase homepageCouchbase logo
Couchbase Developer

  • Docs

    • Integrations
    • SDKs
    • Mobile SDKs

    • AI Developer
    • Backend
    • Full-stack
    • Mobile
    • Ops / DBA

    • Data Modeling
    • Scalability

  • Tutorials

    • Developer Community
    • Ambassador Program
  • Sign In
  • Try Free

Couchbase and .NET

DocsRelease NotesReport IssuesAsk a Question
The .NET SDK

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.

Get Started
DocsRelease NotesReport IssuesAsk a Question
Linq2Couchbase

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.


Get Started

Featured Content

Couchbase GeoSearch

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.

Read More
Microservices

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.

Read More
Couchbase .NET SDK 3.0

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.

Read More

Getting Started

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

Linq2Couchbase

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

ASP.NET Core

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

Get Engaged!

Stack Overflow

Ask your question on Stack Overflow (use the "couchbase" tag)

Use your expertise to browse and answer otherCouchbase questions

Tweet!

Tweet your questions or comments on Twitter.

Use hashtag #couchbase to make sure we see you!

Gitter

Chat with SDK engineers and other SDK users on Gitter.

.NET Forums

Ask your question on the Couchbase .NET SDK forum

Couchbase home page link

3250 Olcott Street
Santa Clara, CA 95054
United States

  • company
  • about
  • leadership
  • news & press
  • investor relations
  • careers
  • events
  • legal
  • contact us
  • support
  • Developer portal
  • Documentation
  • Forums
  • PROFESSIONAL SERVICES
  • support login
  • support policy
  • training
  • quicklinks
  • blog
  • downloads
  • get started
  • resources
  • why nosql
  • pricing
  • follow us
  • Social Media Link for FacebookFacebook
  • Social Media Link for TwitterTwitter
  • Social Media Link for LinkedInLinkedIn
  • Social Media Link for Youtubeyoutube
  • Social Media Link for GitHubGithub
  • Social Media Link for Stack OverflowStack Overflow
  • Social Media Link for Discorddiscord

© 2025 Couchbase, Inc. Couchbase and the Couchbase logo are registered trademarks of Couchbase, Inc. All third party trademarks (including logos and icons) referenced by Couchbase, Inc. remain the property of their respective owners.

Terms of UsePrivacy PolicyCookie PolicySupport PolicyDo Not Sell My Personal InformationMarketing Preference Center