{"id":10010,"date":"2023-06-23T01:43:43","date_gmt":"2023-06-23T08:43:43","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/"},"modified":"2026-10-16T10:22:35","modified_gmt":"2026-10-16T17:22:35","slug":"aspnetcore31-cb65-quickstart","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/","title":{"rendered":"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5"},"content":{"rendered":"\n<h3 id=\"h-prerequisite-run-couchbase-server\" class=\"wp-block-heading\">Prerequisite: Run Couchbase Server<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Couchbase Server 6.5 (or greater) is already running.<\/li>\n\n\n<li>An empty bucket named &#8220;default&#8221; has been created.<\/li>\n\n\n<li>Both a primary index and an adaptive index have been created and built on the default bucket.<\/li>\n\n\n<li>If you still need to perform these tasks please use the following:<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"\/tutorial-docker-image-manual-cb65\">10-minute Couchbase Docker Container Configuration<\/a><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Visual Studio is installed. This tutorial uses <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/\" target=\"_blank\">Visual Studio 2019 16.7<\/a><\/li>\n\n\n<li>A <a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet-core\" target=\"_blank\">.NET Core Runtime<\/a> is installed. This tutorial uses .NET Core 3.1<\/li>\n\n\n<li>A tool to make HTTP requests (e.g. <a href=\"https:\/\/curl.haxx.se\/\" target=\"_blank\">cURL<\/a> or <a href=\"https:\/\/www.postman.com\/\" target=\"_blank\">Postman<\/a>).<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-step-1-start-a-new-project-in-visual-studio\" class=\"wp-block-heading\">Step 1: Start a New Project in Visual Studio<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open Visual Studio 2019 and create a new ASP.NET Core Web Application project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/newProject.png\" alt=\"New Project dialog in Visual Studio 2019\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Name the project, &#8220;QuickStart&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select the API template.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/templateSelect.png\" alt=\"Template select in Visual Studio\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install the latest <a href=\"https:\/\/github.com\/couchbase\/couchbase-net-client\" target=\"_blank\">Couchbase.Extensions.DependencyInjection<\/a> package from NuGet. This will install both the Couchbase .NET SDK and a Dependency Injection extension for ASP.NET Core.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can do this via Visual Studio&#8217;s Package Manager Console like so:<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>Install-Package Couchbase.Extensions.DependencyInjection -Version 2.0.2\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: Alternatively, you can use the NuGet UI by right-clicking &#8220;Dependencies&#8221; in Solution Explore and then &#8220;Manage NuGet Packages&#8221;.<\/p>\n\n\n\n<h3 id=\"h-step-2-asp-net-core-configuration\" class=\"wp-block-heading\">Step 2: ASP.NET Core Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">There are two steps to configure your new ASP.NET Core application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, add a &#8220;Couchbase&#8221; section to the appsettings.json file. If you&#8217;ve followed along with the <a href=\"\/docker-image-manual-cb65\">Couchbase Docker Container Configuration<\/a>, then edit your <code>appsettings.json<\/code> file to add a Couchbase section as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-js\"><code>{\n  &quot;Logging&quot;: {\n    &quot;LogLevel&quot;: {\n      &quot;Default&quot;: &quot;Information&quot;,\n      &quot;Microsoft&quot;: &quot;Warning&quot;,\n      &quot;Microsoft.Hosting.Lifetime&quot;: &quot;Information&quot;\n    }\n  },\n  &quot;AllowedHosts&quot;: &quot;*&quot;,\n  &quot;Couchbase&quot;: {\n    &quot;ConnectionString&quot; : &quot;couchbase:\/\/localhost&quot; ,\n    &quot;Username&quot;: &quot;Administrator&quot;,\n    &quot;Password&quot;: &quot;password&quot;\n  }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The next step is to setup Couchbase in Startup.cs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this, first add <code>services.AddCouchbase(Configuration.GetSection(\"Couchbase\"));<\/code> to the <code>ConfigureServices<\/code> method. Make sure to close the connection as well. You can do this in the <code>Configure<\/code> method by adding an <code>IHostApplicationLifetime<\/code> parameter. Here is the complete Startup.cs:<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>using Couchbase.Extensions.DependencyInjection;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace QuickStart\n{\n    public class Startup\n    {\n        public Startup(IConfiguration configuration)\n        {\n            Configuration = configuration;\n        }\n\n        public IConfiguration Configuration { get; }\n\n        \/\/ This method gets called by the runtime. Use this method to add services to the container.\n        public void ConfigureServices(IServiceCollection services)\n        {\n            services.AddControllers();\n\n            services.AddCouchbase(Configuration.GetSection(&quot;Couchbase&quot;)); \/\/ (1)\n        }\n\n        \/\/ This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\n        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime appLifetime)\n        {\n            if (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage();\n            }\n\n            app.UseHttpsRedirection();\n\n            app.UseRouting();\n\n            app.UseAuthorization();\n\n            app.UseEndpoints(endpoints =&gt;\n            {\n                endpoints.MapControllers();\n            });\n\n            appLifetime.ApplicationStopped.Register(() =&gt; \/\/ (2)\n            {\n                app.ApplicationServices.GetRequiredService&lt;ICouchbaseLifetimeService&gt;().Close();\n            });\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add Couchbase service to ASP.NET Core<\/li>\n\n\n<li>Dispose of Couchbase on ASP.NET Core shutdown<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, your ASP.NET Core application is now configured to use Couchbase.<\/p>\n\n\n\n<h3 id=\"h-step-3-create-new-documents\" class=\"wp-block-heading\">Step 3: Create new documents<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start by creating a simple &#8220;model&#8221; class to represent a user. (Right Click on the project -&gt; Add New Item -&gt; Class -&gt; User.cs)<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>public class User\n{\n    public string FirstName { get; set; }\n    public string LastName { get; set; }\n    public string Email { get; set; }\n    public string TagLine { get; set; }\n    public string Type =&gt; &quot;User&quot;;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s create two controller actions. These will correspond to two API endpoints: one will create a document and one will query a document.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the <code>WeatherForecastController<\/code> with a <code>UserController<\/code> (make sure that <code>UserController<\/code> still has the <code>[ApiController]<\/code> attribute).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: <code>WeatherForecastController<\/code> is a class that&#8217;s created by the Visual Studio API template. If you aren&#8217;t using that template or <code>WeatherForecastController<\/code> isn&#8217;t in your code, you can just create a new <code>UserController<\/code> class that inherits from <code>ControllerBase<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/couchbaselabs\/developer\/tree\/master\/src\/contents\/quickstarts\/aspnetcore31-cb65\/example\" target=\"_blank\">The complete source code available on GitHub<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a constructor in that controller which has an <code>IBucketProvider<\/code> parameter. Use the bucketProvider to get an instance of a Couchbase bucket: <code>_bucket = bucketProvider.GetBucket(\"default\")<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>private readonly IBucket _bucket;\n\npublic UserController(IBucketProvider bucketProvider)\n{\n    _bucket = bucketProvider.GetBucket(&quot;default&quot;);\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use this bucket object to insert plain C# objects into Couchbase. They will be serialized into JSON and stored with a key: <code>_bucket.Insert(key, user);<\/code>. Create an <code>InsertData<\/code> POST method in <code>UserController<\/code> like so:<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>[HttpPost]\n[Route(&quot;\/&quot;)]\npublic string InsertUser(User user)\n{\n    var key = Guid.NewGuid().ToString();\n    _bucket.Insert(key, user);\n    return &quot;Inserted user with ID: &quot; + key;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Compile and run your ASP.NET Core program locally with CTRL+F5. Use cURL or Postman or the HTTP tool of your choice to create three POSTs with JSON content to the specified route. The body of the posts should look something like these:<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>\/\/ first POST\n{\n    &quot;firstName&quot; : &quot;Major&quot;,\n    &quot;lastName&quot; : &quot;Tom&quot;,\n    &quot;email&quot; : &quot;major.tom@acme.com&quot;,\n    &quot;tagLine&quot; : &quot;Send me up a drink&quot;\n}\n\n\/\/ second POST\n{\n    &quot;email&quot;: &quot;perry.mason@acme.com&quot;,\n    &quot;firstName&quot;: &quot;Perry&quot;,\n    &quot;lastName&quot;: &quot;Mason&quot;,\n    &quot;tagLine&quot;: &quot;Who can we get on the case?&quot;\n}\n \n\/\/ third POST\n{\n    &quot;email&quot;: &quot;jerry.wasaracecardriver@acme.com&quot;,\n    &quot;firstName&quot;: &quot;Jerry&quot;,\n    &quot;lastName&quot;: &quot;Wasaracecardriver&quot;,\n    &quot;tagLine&quot;: &quot;el sob number one&quot;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">An example of a cURL command using Powershell to make this request would be:<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>curl --location --request POST &#039;https:\/\/localhost:44316\/&#039; \n--header &#039;Content-Type: application\/json&#039; \n--data-raw &#039;{\n    &quot;firstName&quot; : &quot;Major&quot;,\n    &quot;lastName&quot; : &quot;Tom&quot;,\n    &quot;email&quot; : &quot;major.tom@acme.com&quot;,\n    &quot;tagLine&quot; : &quot;Send me up a drink&quot;\n}&#039;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: If you&#8217;re using Postman, you can copy and paste the above cURL command into Postman. (File-&gt;Import-&gt;Paste Raw Text) Please make sure your port number matches what Visual Studio has set.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: The port number that Visual Studio generates for you will likely be different from 44316 in the above example<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the request is successful, the response will contain the generated ID:<\/p>\n\n\n\n<pre class=\"wp-block-code language-js\"><code>Inserted user with ID: d28a19d4-0c37-447f-b0c0-66a7f2af3c97\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now there are three documents in the default bucket. Next, let&#8217;s query them back out.<\/p>\n\n\n\n<h3 id=\"h-step-4-query-the-documents\" class=\"wp-block-heading\">Step 4: Query the documents<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Query Workbench in the Couchbase UI. Enter a query to select everything from the default bucket:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code>SELECT d.*\nFROM default d\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the inserted documents in the results:<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>[\n  {\n    &quot;email&quot;: &quot;perry.mason@acme.com&quot;,\n    &quot;firstName&quot;: &quot;Perry&quot;,\n    &quot;lastName&quot;: &quot;Mason&quot;,\n    &quot;tagLine&quot;: &quot;Who can we get on the case?&quot;,\n    &quot;type&quot;: &quot;user&quot;\n  },\n  {\n    &quot;email&quot;: &quot;major.tom@acme.com&quot;,\n    &quot;firstName&quot;: &quot;Major&quot;,\n    &quot;lastName&quot;: &quot;Tom&quot;,\n    &quot;tagLine&quot;: &quot;Send me up a drink&quot;,\n    &quot;type&quot;: &quot;user&quot;\n  },\n  {\n    &quot;email&quot;: &quot;jerry.wasaracecardriver@acme.com&quot;,\n    &quot;firstName&quot;: &quot;Jerry&quot;,\n    &quot;lastName&quot;: &quot;Wasaracecardriver&quot;,\n    &quot;tagLine&quot;: &quot;el sob number one&quot;,\n    &quot;type&quot;: &quot;user&quot;\n  }\n]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, create a second controller action called <code>GetUserByEmail<\/code> in UserController.cs. This will be for an API endpoint to retrieve documents, given an email address, using a query like:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code>SELECT d.*\nFROM default d\nWHERE d.email = &quot;major.tom@acme.com&quot;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To execute a query in .NET, start by creating a query string with a named parameter for email: <code>var n1ql = \"SELECT d.* FROM default d WHERE d.email = $email\";<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the string with <code>QueryRequest.Create(...)<\/code> to create a query object. Parameters and other settings can be supplied using this query object. Finally, use the <code>_bucket<\/code> object to execute the query.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>[HttpGet]\n[Route(&quot;\/&quot;)]\npublic List&lt;User&gt; GetUserByEmail(string email)\n{\n    var n1ql = &quot;SELECT d.* FROM default d WHERE d.email = $email&quot;;\n    var query = QueryRequest.Create(n1ql);\n    query.AddNamedParameter(&quot;$email&quot;, email);\n    var result = _bucket.Query&lt;User&gt;(query);\n    return result.Rows;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Compile and run your ASP.NET Core program locally with CTRL+F5. Use cURL or Postman or the HTTP tool of your choice to create a GET with a querystring variable of <code>email<\/code> with the specified email address. Example of a cURL request:<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>curl --location --request GET &#039;https:\/\/localhost:44316\/?email=major.tom@acme.com&#039;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: Since this is a GET, you can make this request from a web browser instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The body of a successful response should look something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code language-js\"><code>[\n    {\n        &quot;firstName&quot; : &quot;Major&quot;,\n        &quot;lastName&quot; : &quot;Tom&quot;,\n        &quot;email&quot; : &quot;major.tom@acme.com&quot;,\n        &quot;tagLine&quot; : &quot;Send me up a drink&quot;\n    }\n]\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-done\" class=\"wp-block-heading\">Done<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve written SQL before, the N1QL queries in this example should look familiar. Instead of querying a table, <code>default<\/code> is the name of a bucket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This tutorial uses the Couchbase .NET SDK 3.x. This same <a href=\"\/aspnetcore31-cb65-quickstart\">quickstart is also available for Couchbase .NET SDK 2.x<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re looking to upgrade from the 2.x to the 3.x SDK, check out this guide for <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/project-docs\/migrating-sdk-code-to-3.n.html\">Migrating from SDK2 to SDK3 API<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Be sure to check out the other quick start exercises.\n<a href=\"https:\/\/github.com\/couchbaselabs\/developer\/tree\/master\/src\/contents\/quickstarts\/aspnetcore31-cb65\/example\" target=\"_blank\">The complete source code is available on GitHub<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prerequisite: Run Couchbase Server 10-minute Couchbase Docker Container Configuration Step 1: Start a New Project in Visual Studio Open Visual Studio 2019 and create a new ASP.NET Core Web Application project. Name the project, &#8220;QuickStart&#8221;. Select the API template. Install the latest Couchbase.Extensions.DependencyInjection package from NuGet. This will install both the Couchbase .NET SDK and [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[405],"tutorial-tags":[474,369],"tutorial-technologies":[371,372],"tutorial-types":[373],"class_list":["post-10010","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-csharp","tutorial-tags-asp-net","tutorial-tags-rest-api","tutorial-technologies-kv","tutorial-technologies-query","tutorial-types-quickstart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.6 (Yoast SEO v28.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5 - Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5\" \/>\n<meta property=\"og:description\" content=\"Prerequisite: Run Couchbase Server 10-minute Couchbase Docker Container Configuration Step 1: Start a New Project in Visual Studio Open Visual Studio 2019 and create a new ASP.NET Core Web Application project. Name the project, &#8220;QuickStart&#8221;. Select the API template. Install the latest Couchbase.Extensions.DependencyInjection package from NuGet. This will install both the Couchbase .NET SDK and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-16T17:22:35+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/aspnetcore31-cb65-quickstart\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/aspnetcore31-cb65-quickstart\\\/\",\"name\":\"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5 - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\"},\"datePublished\":\"2023-06-23T08:43:43+00:00\",\"dateModified\":\"2026-10-16T17:22:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/aspnetcore31-cb65-quickstart\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/aspnetcore31-cb65-quickstart\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/aspnetcore31-cb65-quickstart\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"name\":\"Couchbase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\",\"name\":\"Couchbase\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/logo-1.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/logo-1.svg\",\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5 - Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/","og_locale":"it_IT","og_type":"article","og_title":"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5","og_description":"Prerequisite: Run Couchbase Server 10-minute Couchbase Docker Container Configuration Step 1: Start a New Project in Visual Studio Open Visual Studio 2019 and create a new ASP.NET Core Web Application project. Name the project, &#8220;QuickStart&#8221;. Select the API template. Install the latest Couchbase.Extensions.DependencyInjection package from NuGet. This will install both the Couchbase .NET SDK and [&hellip;]","og_url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/","og_site_name":"Couchbase","article_modified_time":"2026-10-16T17:22:35+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"8 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/","url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/","name":"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5 - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/it\/#website"},"datePublished":"2023-06-23T08:43:43+00:00","dateModified":"2026-10-16T17:22:35+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/aspnetcore31-cb65-quickstart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"ASP.NET Core First Query with Couchbase SDK 2.0 and Couchbase Server 6.5"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/it\/#website","url":"https:\/\/www.couchbase.com\/it\/","name":"Couchbase","description":"","publisher":{"@id":"https:\/\/www.couchbase.com\/it\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/it\/#organization","name":"Couchbase","url":"https:\/\/www.couchbase.com\/it\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/07\/logo-1.svg","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/07\/logo-1.svg","caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/"}}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":1,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10010\/revisions"}],"predecessor-version":[{"id":10434,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10010\/revisions\/10434"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/media?parent=10010"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-languages?post=10010"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-tags?post=10010"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-technologies?post=10010"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-types?post=10010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}