{"id":10357,"date":"2024-01-29T03:42:57","date_gmt":"2024-01-29T11:42:57","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/quickstart-csharp-aspnet\/"},"modified":"2024-01-29T03:42:57","modified_gmt":"2024-01-29T11:42:57","slug":"quickstart-csharp-aspnet","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/","title":{"rendered":"Quickstart in Couchbase with C# and ASP.NET"},"content":{"rendered":"<p class=\"wp-block-paragraph\">In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents and how to write simple parametrized SQL++ queries.<\/p>\n\n\n\n<h3 id=\"h-prerequisites\" class=\"wp-block-heading\">\ud544\uc218 \uc870\uac74<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774 \ubbf8\ub9ac \uad6c\ucd95\ub41c \ud504\ub85c\uc81d\ud2b8\ub97c \uc2e4\ud589\ud558\ub824\uba74 \ub2e4\uc74c\uc774 \ud544\uc694\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.couchbase.com\/ko\/products\/capella\/\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \uce74\ud3a0\ub77c<\/a> \ud074\ub7ec\uc2a4\ud130\uc640 \ud568\uaed8 <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/ref\/travel-app-data-model.html\">\uc5ec\ud589 \uc0d8\ud50c<\/a> \ubc14\uad6c\ub2c8\uac00 \ucc44\uc6cc\uc84c\uc2b5\ub2c8\ub2e4.\n<ul>\n<li>To run this tutorial using a self managed Couchbase cluster, please refer to the <a href=\"#running-self-managed-couchbase-cluster\">appendix<\/a>.<\/li>\n<\/ul>\n<\/li>\n\n\n<li><a href=\"https:\/\/dotnet.microsoft.com\/en-us\/download\/dotnet\">.NET SDK v6+<\/a> installed.\n<ul>\n<li>Ensure that the .Net version is <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/project-docs\/compatibility.html#dotnet-compatibility\">compatible<\/a> with the Couchbase SDK.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>Code Editor installed (Visual Studio Professional, Visual Studio Code, or JetBrains Rider)<\/li>\n\n\n<li>Loading Travel Sample Bucket\n<ul>\n<li>If travel-sample is not loaded in your Capella cluster, you can load it by following the instructions for your Capella Cluster:\n<ul>\n<li><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/data-service\/import-data-documents.html#import-sample-data\">Couchbase Capella\uc5d0\uc11c \ud2b8\ub798\ube14 \uc0d8\ud50c \ubc84\ud0b7 \ub85c\ub4dc\ud558\uae30<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-couchbase-capella-configuration\" class=\"wp-block-heading\">Couchbase Capella \uc124\uc815<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Couchbase\ub97c \uc2e4\ud589\ud560 \ub54c <a href=\"https:\/\/cloud.couchbase.com\/\">Capella<\/a>, the following prerequisites need to be met.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The application requires the travel-sample bucket to be <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/data-service\/import-data-documents.html#import-sample-data\">loaded<\/a> in the cluster from the Capella UI.<\/li>\n\n\n<li>Create the <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/manage-database-users.html\">\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc790\uaca9 \uc99d\uba85<\/a> \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 travel-sample \ubc84\ud0b7(\uc77d\uae30 \ubc0f \uc4f0\uae30)\uc5d0 \uc561\uc138\uc2a4\ud569\ub2c8\ub2e4.<\/li>\n\n\n<li><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/allow-ip-address.html\">\uc811\uadfc \ud5c8\uc6a9<\/a> \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8\uc774 \uc2e4\ud589\ub418\ub294 IP\uc5d0\uc11c \ud074\ub7ec\uc2a4\ud130\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4.<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-app-setup\" class=\"wp-block-heading\">App Setup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\uc6b0\ub9ac\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud558\uae30 \uc704\ud574 \ud544\uc694\ud55c \ub2e4\uc591\ud55c \ub2e8\uacc4\ub97c \uac70\uce60 \uac83\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<h4 id=\"h-cloning-repo\" class=\"wp-block-heading\">\ud074\ub85c\ub2dd \ub9ac\ud3ec<\/h4>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>git clone https:\/\/github.com\/couchbase-examples\/aspnet-quickstart.git\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-install-dependencies\" class=\"wp-block-heading\">\uc758\uc874\uc131 \uc124\uce58\ud558\uae30<\/h4>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>cd src\/Org.Quickstart.API\ndotnet restore\n<\/code><\/pre>\n\n\n\n<h5 id=\"h-dependency-injection-nuget-package\" class=\"wp-block-heading\">Dependency Injection Nuget package<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The Couchbase SDK for .NET includes a nuget package called <code>Couchbase.Extensions.DependencyInjection<\/code> which is designed for environments like ASP.NET that takes in a configuration to connect to Couchbase and automatically registers interfaces that you can use in your code to perform full <code>CRUD (create, read, update, delete)<\/code> operations and queries against the database.<\/p>\n\n\n\n<h4 id=\"h-setup-database-configuration\" class=\"wp-block-heading\">\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uad6c\uc131 \uc124\uc815<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Capella \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \ub2e4\uc74c\uc744 \ub530\ub974\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4. <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/connect.html\">\uc9c0\uce68<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud2b9\ud788, \ub2e4\uc74c \uc0ac\ud56d\uc744 \uc218\ud589\ud574\uc57c \ud569\ub2c8\ub2e4:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/manage-database-users.html\">\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc790\uaca9 \uc99d\uba85<\/a> \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 travel-sample \ubc84\ud0b7(\uc77d\uae30 \ubc0f \uc4f0\uae30)\uc5d0 \uc561\uc138\uc2a4\ud569\ub2c8\ub2e4.<\/li>\n\n\n<li><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/allow-ip-address.html\">\uc811\uadfc \ud5c8\uc6a9<\/a> \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8\uc774 \uc2e4\ud589\ub418\ub294 IP\uc5d0\uc11c \ud074\ub7ec\uc2a4\ud130\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">All configuration for communication with the database is stored in the <a href=\"https:\/\/github.com\/couchbase-examples\/aspnet-quickstart\/blob\/main\/src\/Org.Quickstart.API\/appsettings.Development.json\">appsettings.Development.json<\/a> file.  This includes the connection string, username, password, bucket name and scope name.  The default username is assumed to be <code>Administrator<\/code> and the default password is assumed to be <code>P@$$w0rd12<\/code>.  If these are different in your environment you will need to change them before running the application.<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>  &quot;Couchbase&quot;: {\n    &quot;BucketName&quot;: &quot;travel-sample&quot;,\n    &quot;ScopeName&quot;: &quot;inventory&quot;,\n    &quot;ConnectionString&quot;: &quot;couchbases:\/\/yourassignedhostname.cloud.couchbase.com&quot;,\n    &quot;Username&quot;: &quot;Administrator&quot;,\n    &quot;Password&quot;: &quot;P@ssw0rd12&quot;,\n    &quot;IgnoreRemoteCertificateNameMismatch&quot;: true,\n    &quot;HttpIgnoreRemoteCertificateMismatch&quot;: true,\n    &quot;KvIgnoreRemoteCertificateNameMismatch&quot;: true\n  }\n\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ucc38\uace0: \uc5f0\uacb0 \ubb38\uc790\uc5f4\uc740 <code>couchbases:\/\/<\/code> \ub610\ub294 <code>couchbase:\/\/<\/code> \ubd80\ubd84.<\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-running-the-application\" class=\"wp-block-heading\">\uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8 \uc2e4\ud589\ud558\uae30<\/h3>\n\n\n\n<h4 id=\"h-directly-on-machine\" class=\"wp-block-heading\">\uae30\uacc4 \ubc14\ub85c \uc704\uc5d0<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, we have installed the dependencies, loaded the travel-sample data and configured the application with the credentials. The application is now ready and you can run it.<\/p>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>cd src\/Org.Quickstart.API\ndotnet run\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-using-docker\" class=\"wp-block-heading\">Using Docker<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Build the Docker image<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>cd aspnet-quickstart\ndocker build -t couchbase-aspnet-quickstart . \n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run the docker image<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>cd aspnet-quickstart\ndocker run -e DB_CONN_STR=&lt;connection_string&gt; -e DB_USERNAME=&lt;user_with_read_write_permission_to_travel-sample_bucket&gt; -e DB_PASSWORD=&lt;password_for_user&gt; -p 8080:8080 couchbase-aspnet-quickstart\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can access the Application on <a href=\"http:\/\/localhost:8080\/index.html\">http:\/\/localhost:8080\/index.html<\/a><\/p>\n\n\n\n<h4 id=\"h-verifying-the-application\" class=\"wp-block-heading\">\uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8 \ud655\uc778<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once the application starts, you can see the details of the application on the logs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"app_startup.png\" alt=\"Application Startup\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The application will run on port 8080 of your local machine (<a href=\"http:\/\/localhost:8080\/index.html\">http:\/\/localhost:8080\/index.html<\/a>). You will find the Swagger documentation of the API if you go to the URL in your browser.\nSwagger documentation is used in this demo to showcase the different API end points and how they can be invoked. More details on the Swagger documentation can be found in the <a href=\"#swagger-documentation\">appendix<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"swagger_documentation.png\" alt=\"Swagger Documentation\"><\/p>\n\n\n\n<h3 id=\"h-data-model\" class=\"wp-block-heading\">Data Model<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For this tutorial, we use three collections, <code>airport<\/code>, <code>\ud56d\uacf5\uc0ac<\/code> \uadf8\ub9ac\uace0 <code>route<\/code> that contain sample airports, airlines and airline routes respectively. The route collection connects the airports and airlines as seen in the figure below. We use these connections in the quickstart to generate airports that are directly connected and airlines connecting to a destination airport. Note that these are just examples to highlight how you can use SQL++ queries to join the collections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"travel_sample_data_model.png\" alt=\"img\"><\/p>\n\n\n\n<h3 id=\"h-let-us-review-the-code\" class=\"wp-block-heading\">Let Us Review the Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To begin this tutorial, clone the repo and open it up in the IDE of your choice. Now you can learn about how to create, read, update and delete documents in Couchbase Server.<\/p>\n\n\n\n<h4 id=\"h-code-layout\" class=\"wp-block-heading\">Code Layout<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\u251c\u2500\u2500 src\n\u2502   \u251c\u2500\u2500 Org.Quickstart.API\n\u2502   \u2502   \u251c\u2500\u2500 Controllers\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 AirlineController.cs\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 AirportController.cs\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 RouteController.cs\n\u2502   \u2502   \u251c\u2500\u2500 Models\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 Airline.cs\n\u2502   \u2502   \u2502   \u251c\u2500\u2500 Airport.cs\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 Route.cs\n\u2502   \u2502   \u251c\u2500\u2500 Properties\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 launchSettings.json\n\u2502   \u2502   \u251c\u2500\u2500 Services\n\u2502   \u2502   \u2502   \u2514\u2500\u2500 InventoryScopeService.cs\n\u2502   \u2502   \u251c\u2500\u2500 Couchbase.TravelSample.csproj\n\u2502   \u2502   \u251c\u2500\u2500 Program.cs\n\u2502   \u2502   \u2514\u2500\u2500 appsettings.Development.json\n\u2502   \u2514\u2500\u2500 Org.Quickstart.IntegrationTests\n\u2502       \u251c\u2500\u2500 ControllerTests\n\u2502       \u2502   \u251c\u2500\u2500 AirlineTests.cs\n\u2502       \u2502   \u251c\u2500\u2500 AirportTests.cs\n\u2502       \u2502   \u2514\u2500\u2500 RouteTests.cs  \n\u2502       \u2514\u2500\u2500 Org.Quickstart.IntegrationTests.csproj\n\u251c\u2500\u2500 Org.Quickstart.sln\n\u2514\u2500\u2500 Dockerfile\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Org.Quickstart.API.Program:<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to use the <code>Couchbase.Extensions.DependencyInjection<\/code> framework, we must first register the service.  The Couchbase Services requires the database configuration information, which can be provided by reading the database configuration from the <code>appsettings.Development.json<\/code> file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>\/\/ Register the configuration for Couchbase and Dependency Injection Framework\n builder.Services.Configure&lt;CouchbaseConfig&gt;(config);\n builder.Services.AddCouchbase(config);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The services are added to the DI container. CORS policy is defined to allow specific origins. HttpClient, Controllers, Endpoints API Explorer, and Swagger are also added here. The Swagger setup includes a detailed description of the API.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>builder.Services.AddCors(options =&gt;\n{\n    \/\/ ...\n});\n\nbuilder.Services.AddHttpClient();\nbuilder.Services.AddControllers();\n\nbuilder.Services.AddEndpointsApiExplorer();\nbuilder.Services.AddSwaggerGen(options =&gt;\n{\n    \/\/ ...\n});\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The InventoryScopeService is registered as a singleton service in the DI container.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>builder.Services.AddSingleton&lt;IInventoryScopeService, InventoryScopeService&gt;();\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">ASP.NET has an interface called <code>IHostApplicationLifetime<\/code> that you can add to your Configure method to help with registration of lifetime events. The Couchbase SDK provides the <code>ICouchbaseLifetimeService<\/code> interface for handling closing the database connections when the application closes.\nIt&#8217;s best practice to register for the ASP.NET <code>ApplicationStop<\/code> lifetime event and call the <code>ICouchbaseLifetimeService<\/code> Close method so that the database connection and resources are closed and removed gracefully.\nThe program logs the Swagger UI address when the application starts.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>var lifetime = app.Services.GetRequiredService&lt;IHostApplicationLifetime&gt;();\n\nlifetime.ApplicationStarted.Register(() =&gt;\n{\n    \/\/ ...\n});\n\napp.Lifetime.ApplicationStopped.Register(() =&gt;\n{\n    var cls = app.Services.GetRequiredService&lt;ICouchbaseLifetimeService&gt;();\n    cls.Close();\n});\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The program sets up the middleware pipeline for the application. This includes Swagger, CORS, HTTPS redirection, routing, authorization, and endpoint mapping.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>app.UseSwagger();\napp.UseSwaggerUI(c =&gt; {\n    c.SwaggerEndpoint(&quot;\/swagger\/v1\/swagger.json&quot;, &quot;Couchbase Quickstart API v1&quot;); \n    c.RoutePrefix = string.Empty;\n});\n\nif (app.Environment.EnvironmentName == &quot;Testing&quot;)\n{\n    app.UseCors(&quot;_devAllowSpecificOrigins&quot;);\n}\n\napp.UseHttpsRedirection();\napp.UseRouting();\napp.UseAuthorization();\napp.UseEndpoints(endpoints =&gt;\n{\n    endpoints.MapControllers();\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Couchbase .NET SDK will handle all communications to the database cluster, so you shouldn&#8217;t need to worry about creating a pool of connections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This <code>InventoryScopeService<\/code> class is a service that provides a convenient way to fetch a specific scope from a specific bucket, handling all the necessary validation and error checking.<\/p>\n\n\n\n<h4 id=\"h-airport-entity\" class=\"wp-block-heading\">Airport Entity<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">For this tutorial, we will focus on the airport entity. The other entities are similar.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will be setting up a REST API to manage airport documents.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#post-airport\">POST Airport<\/a> \u2013 Create a new airport<\/li>\n\n\n<li><a href=\"#get-airport\">GET Airport<\/a> \u2013 Read specified airport<\/li>\n\n\n<li><a href=\"#put-airport\">PUT Airport<\/a> \u2013 Update specified airport<\/li>\n\n\n<li><a href=\"#delete-airport\">DELETE Airport<\/a> \u2013 Delete airport<\/li>\n\n\n<li><a href=\"#list-airport\">Airport List<\/a> \u2013 Get all airports. Optionally filter the list by country<\/li>\n\n\n<li><a href=\"#direct-connections\">Direct Connections<\/a> &#8211; Get a list of airports directly connected to the specified airport<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For CRUD operations, we will use the <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/howtos\/kv-operations.html\">Key-Value operations<\/a> that are built into the Couchbase SDK to create, read, update, and delete a document. Every document will need an ID (similar to a primary key in other databases) to save it to the database. This ID is passed in the URL. For other end points, we will use <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/howtos\/n1ql-queries-with-sdk.html\">SQL++<\/a> to query for documents.<\/p>\n\n\n\n<h4 id=\"h-airport-document-structure\" class=\"wp-block-heading\">Airport Document Structure<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Our airport document will have an airportname, city, country, faa code, icao code, timezone info and the geographic coordinates. For this demo, we will store all airport information in one document in the <code>airport<\/code> collection in the <code>\uc5ec\ud589 \uc0d8\ud50c<\/code> \ubc14\uad6c\ub2c8.<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>{\n  &quot;airportname&quot;: &quot;Sample Airport&quot;,\n  &quot;city&quot;: &quot;Sample City&quot;,\n  &quot;country&quot;: &quot;United Kingdom&quot;,\n  &quot;faa&quot;: &quot;SAA&quot;,\n  &quot;icao&quot;: &quot;SAAA&quot;,\n  &quot;tz&quot;: &quot;Europe\/Paris&quot;,\n  &quot;geo&quot;: {\n    &quot;lat&quot;: 48.864716,\n    &quot;lon&quot;: 2.349014,\n    &quot;alt&quot;: 92\n  }\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-post-airport\" class=\"wp-block-heading\">POST Airport<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>AirportController.cs<\/code> file  and navigate to the <code>Post<\/code> method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It takes an <code>id<\/code> and a <code>\uc694\uccad<\/code> as parameters, where <code>id<\/code> is the unique identifier for the airport and <code>\uc694\uccad<\/code> contains the data for the new airport. The method extracts the <code>airport<\/code> object from the <code>\uc694\uccad<\/code> and attempts to insert it into the collection using the <code>InsertAsync<\/code> method of the Couchbase SDK. If the insertion is successful, it returns a <code>Created<\/code> result. However, if a document with the same id already exists in the collection, the method catches a <code>DocumentExistsException<\/code> and returns a <code>Conflict<\/code> result. For any other exceptions, it logs the error message and returns an <code>InternalServerError<\/code> result.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>public async Task&lt;IActionResult&gt; Post(string id, AirportCreateRequestCommand request)\n{\n    try\n    {\n        var collection = await _inventoryScope.CollectionAsync(CollectionName);\n        var airport = request.GetAirport();\n        await collection.InsertAsync(id, airport);\n        return Created($&quot;\/api\/v1\/airport\/{id}&quot;, airport);\n    }\n    catch (DocumentExistsException)\n    {\n        return Conflict($&quot;A document with the ID &#039;{id}&#039; already exists.&quot;);\n    }\n    catch (Exception ex)\n    {\n        _logger.LogError(ex.Message);\n        return StatusCode(StatusCodes.Status500InternalServerError, $&quot;Error: {ex.Message} {ex.StackTrace} {Request.GetDisplayUrl()}&quot;);\n    }\n}\n\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-get-airport\" class=\"wp-block-heading\">GET Airport<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>AirportController.cs<\/code> file  and navigate to the <code>GetById<\/code> method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This method retrieves an airport document from a collection using its <code>id<\/code>. It uses the <code>GetAsync<\/code> method of the Couchbase SDK to fetch the document. If the document exists, it returns the document; otherwise, it returns a <code>NotFound<\/code> result. Any other exceptions are caught, logged, and an <code>InternalServerError<\/code> result is returned.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>public async Task&lt;IActionResult&gt; GetById(string id)\n{\n    try\n    {\n        var collection = await _inventoryScope.CollectionAsync(CollectionName);\n        var result = await collection.GetAsync(id);\n        var resultAirport = result.ContentAs&lt;Airport&gt;();\n        if (resultAirport != null)\n        {\n            return Ok(resultAirport);\n        }\n    }\n    catch (DocumentNotFoundException)\n    {\n        return NotFound();\n    }\n    catch (Exception ex)\n    {\n        _logger.LogError(ex.Message);\n        return StatusCode(StatusCodes.Status500InternalServerError, $&quot;Error: {ex.Message} {ex.StackTrace} {Request.GetDisplayUrl()}&quot;);\n    }\n    return NotFound();\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-put-airport\" class=\"wp-block-heading\">PUT Airport<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>AirportController.cs<\/code> file  and navigate to the <code>\uc5c5\ub370\uc774\ud2b8<\/code> method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This method is used to update an existing airport document in the collection. It uses the <code>GetAsync<\/code> \uadf8\ub9ac\uace0 <code>ReplaceAsync<\/code> methods from the Couchbase SDK. If the document with the specified <code>id<\/code> exists, it replaces the document with the new data from the <code>\uc694\uccad<\/code>. If the document does not exist, it returns a <code>NotFound<\/code> result. Any other exceptions are caught, logged, and an <code>InternalServerError<\/code> result is returned.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>public async Task&lt;IActionResult&gt; Update(string id, AirportCreateRequestCommand request)\n{\n    try\n    {\n        var collection = await _inventoryScope.CollectionAsync(CollectionName);\n        if (await collection.GetAsync(id) is { } result)\n        {\n            result.ContentAs&lt;Airport&gt;();\n            await collection.ReplaceAsync(id, request.GetAirport());\n            return Ok(request);\n        }\n        else\n        {\n            return NotFound();\n        }\n    }\n    catch (DocumentNotFoundException)\n    {\n        return NotFound();\n    }\n    catch (Exception ex)\n    {\n        _logger.LogError(ex.Message);\n        return StatusCode(StatusCodes.Status500InternalServerError, $&quot;Error: {ex.Message} {ex.StackTrace} {Request.GetDisplayUrl()}&quot;);\n    }\n    return NotFound();\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-delete-airport\" class=\"wp-block-heading\">DELETE Airport<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>AirportController.cs<\/code> file  and navigate to the <code>\uc0ad\uc81c<\/code> method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This method used to delete an existing airport document from a Couchbase collection. It uses the <code>GetAsync<\/code> \uadf8\ub9ac\uace0 <code>RemoveAsync<\/code> methods from the Couchbase SDK. If the document with the specified <code>id<\/code> exists, it removes the document from the collection. If the document does not exist, it returns a <code>NotFound<\/code> result. Any other exceptions are caught, logged, and an <code>InternalServerError<\/code> result is returned.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>public async Task&lt;IActionResult&gt; Delete(string id)\n{\n    try\n    {\n        var collection = await _inventoryScope.CollectionAsync(CollectionName);\n        var result = await collection.GetAsync(id);\n        var resultAirport = result.ContentAs&lt;Airport&gt;();\n        if (resultAirport != null)\n        {\n            await collection.RemoveAsync(id);\n            return Ok(id);\n        }\n        else\n        {\n            return NotFound();\n        }\n    }\n    catch (DocumentNotFoundException)\n    {\n        return NotFound();\n    }\n    catch (Exception ex)\n    {\n        _logger.LogError(ex.Message);\n        return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);\n    }\n    return NotFound();\n}\n\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-list-airport\" class=\"wp-block-heading\">List Airport<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This endpoint retrieves the list of airports in the database. The API has options to specify the page size for the results and country from which to fetch the airport documents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/howtos\/n1ql-queries-with-sdk.html\">SQL++<\/a> is a powerful query language based on SQL, but designed for structured and flexible JSON documents. We will use a SQL+ query to search for airports with Limit, Offset, and Country option.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>AirportController.cs<\/code> file  and navigate to the <code>\uc0ad\uc81c<\/code> method. This endpoint is different from the others we have seen before because it makes the SQL++ query rather than a key-value operation. This usually means more overhead because the query engine is involved. For this query, we are using the predefined indices in the <code>\uc5ec\ud589 \uc0d8\ud50c<\/code> bucket. We can create an additional <a href=\"https:\/\/docs.couchbase.com\/server\/current\/learn\/services-and-indexes\/indexes\/indexing-and-query-perf.html\">\uc778\ub371\uc2a4<\/a> specific for this query to make it perform better.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We need to get the values from the query string for country, limit, and Offset that we will use in our query. These are pulled from the <code>queryParameters.Parameter<\/code> method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This end point has two queries depending on the value for the country parameter. If a country name is specified, we retrieve the airport documents for that specific country. If it is not specified, we retrieve the list of airports across all countries. The queries are slightly different for these two scenarios.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We build our SQL++ query using the <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/howtos\/n1ql-queries-with-sdk.html#parameterized-queries\">parameters<\/a> specified by <code>$<\/code> symbol for both these scenarios. The difference between the two queries is the presence of the <code>country<\/code> parameter in the query. Normally for the queries with pagination, it is advised to order the results to maintain the order of results across multiple queries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we pass that <code>\uc9c8\ubb38<\/code> to the <code>QueryAsync<\/code> method. We save the results in a list, <code>items<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This endpoint calls the <code>QueryAsync<\/code> method defined in the <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/howtos\/n1ql-queries-with-sdk.html#querying-at-scope-level\">\ubc94\uc704<\/a> by the Couchbase SDK.<\/p>\n\n\n\n<pre class=\"wp-block-code language-csharp\"><code>           \n           var queryParameters = new Couchbase.Query.QueryOptions();\n\t\t   queryParameters.Parameter(&quot;limit&quot;, limit ?? 10);\n\t\t   queryParameters.Parameter(&quot;offset&quot;, offset ?? 0);\n\n\t\t   string query;\n\t\t   if (!string.IsNullOrEmpty(country))\n\t\t   {\n\t\t\t   query = $@&quot;SELECT airport.airportname,\n                          airport.city,\n                          airport.country,\n                          airport.faa,\n                          airport.geo,\n                          airport.icao,\n                          airport.tz\n                        FROM airport AS airport\n                        WHERE lower(airport.country) = $country\n                        ORDER BY airport.airportname\n                        LIMIT $limit\n                        OFFSET $offset&quot;;\n                    \n\t\t\t   queryParameters.Parameter(&quot;country&quot;, country.ToLower());\n\t\t   }\n\t\t   else\n\t\t   {\n\t\t\t   query = $@&quot;SELECT airport.airportname,\n                              airport.city,\n                              airport.country,\n                              airport.faa,\n                              airport.geo,\n                              airport.icao,\n                              airport.tz\n                            FROM airport AS airport\n                            ORDER BY airport.airportname\n                            LIMIT $limit\n                            OFFSET $offset&quot;;\n\t\t   }\n\n\t\t   var results = await _inventoryScope.QueryAsync&lt;Airport&gt;(query, queryParameters);\n\t\t   var items = await results.Rows.ToListAsync();\n\n\t\t   return items.Count == 0 ? NotFound() : Ok(items);\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-direct-connections\" class=\"wp-block-heading\">Direct Connections<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This endpoint fetches the airports that can be reached directly from the specified source airport code. This also uses a SQL++ query to fetch the results similar to the List Airport endpoint.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us look at the query used here:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code>SELECT distinct (route.destinationairport)\nFROM airport as airport\nJOIN route as route on route.sourceairport = airport.faa\nWHERE airport.faa = $airport and route.stops = 0\nORDER BY route.destinationairport\nLIMIT $limit\nOFFSET $offset\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We are fetching the direct connections by joining the airport collection with the route collection and filtering based on the source airport specified by the user and by routes with no stops.<\/p>\n\n\n\n<h3 id=\"h-running-the-tests\" class=\"wp-block-heading\">Running The Tests<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We have defined integration tests using the <a href=\"https:\/\/xunit.net\/\">xunit<\/a> nuget package for all the API end points. The integration tests use the same database configuration as the application. For the integration tests, we perform the operation using the API and confirm the results by checking the documents in the database. For example, to check the creation of the document by the API, we would call the API to create the document and then read the same document from the database and compare them. After the tests, the documents are cleaned up by calling the DELETE endpoint<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To run the standard integration tests, use the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>cd ..\/Org.Quickstart.IntegrationTests\/\ndotnet restore \ndotnet build\ndotnet test\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-appendix\" class=\"wp-block-heading\">Appendix<\/h3>\n\n\n\n<h4 id=\"h-extending-api-by-adding-new-entity\" class=\"wp-block-heading\">Extending API by Adding New Entity<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you would like to add another entity to the APIs, these are the steps to follow:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the new entity (collection) in the Couchbase bucket. You can create the collection using the <a href=\"https:\/\/docs.couchbase.com\/sdk-api\/couchbase-net-client\/api\/Couchbase.Management.Collections.ICouchbaseCollectionManager.html#Couchbase_Management_Collections_ICouchbaseCollectionManager_CreateCollectionAsync_Couchbase_Management_Collections_CollectionSpec_Couchbase_Management_Collections_CreateCollectionOptions_\">SDK<\/a> or via the <a href=\"https:\/\/docs.couchbase.com\/cloud\/n1ql\/n1ql-language-reference\/createcollection.html\">Couchbase Server interface<\/a>.<\/li>\n\n\n<li>Define the routes inside a new file in the <code>Controllers<\/code> folder similar to the existing ones like <code>AirportController.cs<\/code>.<\/li>\n\n\n<li>Add the tests for the new routes in a new file in the <code>ControllerTests<\/code> folder similar to <code>AirportTests.cs<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-running-self-managed-couchbase-cluster\" class=\"wp-block-heading\">Running Self Managed Couchbase Cluster<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you are running this quickstart with a self managed Couchbase cluster, you need to <a href=\"https:\/\/docs.couchbase.com\/server\/current\/manage\/manage-settings\/install-sample-buckets.html\">load<\/a> the travel-sample data bucket in your cluster and generate the credentials for the bucket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need to update the connection string and the credentials in the <a href=\"https:\/\/github.com\/couchbase-examples\/aspnet-minapi-quickstart-travelsample\/blob\/main\/src\/Couchbase.TravelSample\/appsettings.Development.json\">appsettings.Development.json<\/a> file in the source folder.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\ucc38\uace0:<\/strong> Couchbase must be installed and running prior to running the the ASP.NET app.<\/p>\n<\/blockquote>\n\n\n\n<h4 id=\"h-swagger-documentation\" class=\"wp-block-heading\">Swagger Documentation<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Swagger documentation provides a clear view of the API including endpoints, HTTP methods, request parameters, and response objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click on an individual endpoint to expand it and see detailed information. This includes the endpoint&#8217;s description, possible response status codes, and the request parameters it accepts.<\/p>\n\n\n\n<h5 id=\"h-trying-out-the-api\" class=\"wp-block-heading\">Trying Out the API<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">You can try out an API by clicking on the &#8220;Try it out&#8221; button next to the endpoints.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Parameters: If an endpoint requires parameters, Swagger UI provides input boxes for you to fill in. This could include path parameters, query strings, headers, or the body of a POST\/PUT request.<\/p>\n<\/li>\n\n\n<li>\n<p>Execution: Once you&#8217;ve inputted all the necessary parameters, you can click the &#8220;Execute&#8221; button to make a live API call. Swagger UI will send the request to the API and display the response directly in the documentation. This includes the response code, response headers, and response body.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<h5 id=\"h-models\" class=\"wp-block-heading\">\ubaa8\ub378\ub4e4<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Swagger documents the structure of request and response bodies using models. These models define the expected data structure using JSON schema and are extremely helpful in understanding what data to send and expect.<\/p>","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents and how to write simple parametrized SQL++ queries. Prerequisites To run this prebuilt project, you will need: Couchbase Capella Configuration When running Couchbase using Capella, the following prerequisites need to be met. App Setup [&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":[582],"tutorial-tags":[651,546],"tutorial-technologies":[572,548,549],"tutorial-types":[550],"class_list":["post-10357","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-csharp","tutorial-tags-asp-net","tutorial-tags-rest-api","tutorial-technologies-index","tutorial-technologies-kv","tutorial-technologies-query","tutorial-types-quickstart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Quickstart in Couchbase with C# and ASP.NET - 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\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickstart in Couchbase with C# and ASP.NET\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents and how to write simple parametrized SQL++ queries. Prerequisites To run this prebuilt project, you will need: Couchbase Capella Configuration When running Couchbase using Capella, the following prerequisites need to be met. App Setup [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"15\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/quickstart-csharp-aspnet\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/quickstart-csharp-aspnet\\\/\",\"name\":\"Quickstart in Couchbase with C# and ASP.NET - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#website\"},\"datePublished\":\"2024-01-29T11:42:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/quickstart-csharp-aspnet\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/quickstart-csharp-aspnet\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/quickstart-csharp-aspnet\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickstart in Couchbase with C# and ASP.NET\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickstart in Couchbase with C# and ASP.NET - 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\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/","og_locale":"ko_KR","og_type":"article","og_title":"Quickstart in Couchbase with C# and ASP.NET","og_description":"In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents and how to write simple parametrized SQL++ queries. Prerequisites To run this prebuilt project, you will need: Couchbase Capella Configuration When running Couchbase using Capella, the following prerequisites need to be met. App Setup [&hellip;]","og_url":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"15\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/","url":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/","name":"Quickstart in Couchbase with C# and ASP.NET - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/ko\/#website"},"datePublished":"2024-01-29T11:42:57+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/quickstart-csharp-aspnet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Quickstart in Couchbase with C# and ASP.NET"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/ko\/#website","url":"https:\/\/www.couchbase.com\/ko\/","name":"\ucf54\uc6b0\uce58\ubca0\uc774\uc2a4","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/ko\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/ko\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/ko\/#organization","name":"\ucf54\uc6b0\uce58\ubca0\uc774\uc2a4","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/ko\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/ko\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/ko\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase\ub294 \uce98\ub9ac\ud3ec\ub2c8\uc544\uc8fc \uc0cc\ud638\uc138\uc5d0 \ubcf8\uc0ac\ub97c \ub454 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \ud68c\uc0ac\ub85c, \uc218\ubc31 \uac1c\uc758 \uae00\ub85c\ubc8c \uae30\uc5c5\uc5d0\uc11c \ud65c\uc6a9\ud558\ub294 \uc778\uacf5\uc9c0\ub2a5\uc744 \uc704\ud55c \uc6b4\uc601 \ub370\uc774\ud130 \ud50c\ub7ab\ud3fc\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials\/10357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials\/10357\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/media?parent=10357"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-languages?post=10357"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-tags?post=10357"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-technologies?post=10357"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-types?post=10357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}