From 26a80e5d80c2ba7395558569aca0f7b7791ad872 Mon Sep 17 00:00:00 2001 From: FreeBono Date: Fri, 17 Jan 2025 15:33:57 +0900 Subject: [PATCH 1/2] Add instructions for API Dash-generated code in csharp(HttpClient) --- .../instructions_to_run_generated_code.md | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/doc/user_guide/instructions_to_run_generated_code.md b/doc/user_guide/instructions_to_run_generated_code.md index e3bac1fa..3ef3cfdd 100644 --- a/doc/user_guide/instructions_to_run_generated_code.md +++ b/doc/user_guide/instructions_to_run_generated_code.md @@ -43,7 +43,84 @@ TODO ## C# (HttpClient) -TODO +Here are the detailed instructions for running the generated API Dash code in C# (using `HttpClient`) for macOS, Windows, and Linux: + + +### 1. Setting Up the C# Development Environment +#### macOS and Windows: +1. **Install .NET SDK:** + - Visit the [official .NET download page](https://dotnet.microsoft.com/download). + - Download and install the latest .NET SDK for macOS. +2. **Verify Installation:** + - Open the terminal and run the following command to verify the installation: + ```bash + dotnet --version + ``` + + +#### Linux: +1. **Install .NET SDK:** + - Run the following commands based on your distribution: + - For Ubuntu/Debian-based systems: + ```bash + sudo apt update + sudo apt install dotnet-sdk-7.0 + ``` + - For Fedora/CentOS-based systems: + ```bash + sudo dnf install dotnet-sdk-7.0 + ``` +2. **Verify Installation:** + - Open the terminal and run the following command to verify the installation: + ```bash + dotnet --version + ``` + +### 2. Preparing HttpClient + +#### In Visual Studio: +1. **Create a New Project:** + - Open Visual Studio and select **Create a new project**. + - Choose the **Console Application (.NET Core)** template and create the project. + +2. **Check `System.Net.Http` Namespace:** + - `HttpClient` is included by default. No additional installation is required. + +#### Using the CLI: +1. **Create a Project:** + ```bash + dotnet new console -n HttpClientExample + cd HttpClientExample + ``` + +2. **Install the Package (if necessary):** + ```bash + dotnet add package System.Net.Http + ``` + +### 3. Execute the generated code: +Once you have .NET(C#) and `HttpClient` installed, follow these steps to execute the generated code: + +1. **Open a IDE/text editor** ✍️ (Visual Studio, VS Code or any other text editor). +2. **Copy the generated code** 📋 from API Dash. +3. **Paste the code** into your project. ex) prgoram.cs + + +### 4. Running the Project + +#### In Visual Studio: +1. Click the **Start Debugging (F5)** button from the top menu to run the project. +2. The output window will display the API response. + +#### Using the CLI: +1. Open the terminal at the project root directory and run the following command: + ```bash + dotnet run + ``` + + + + ## C# (RestSharp) From 37b6c02e9bb465a20bb6e7380539a994bec6f195 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 18 Jan 2025 23:41:19 +0530 Subject: [PATCH 2/2] Update instructions_to_run_generated_code.md --- doc/user_guide/instructions_to_run_generated_code.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/user_guide/instructions_to_run_generated_code.md b/doc/user_guide/instructions_to_run_generated_code.md index 3ef3cfdd..2972db05 100644 --- a/doc/user_guide/instructions_to_run_generated_code.md +++ b/doc/user_guide/instructions_to_run_generated_code.md @@ -45,7 +45,6 @@ TODO Here are the detailed instructions for running the generated API Dash code in C# (using `HttpClient`) for macOS, Windows, and Linux: - ### 1. Setting Up the C# Development Environment #### macOS and Windows: 1. **Install .NET SDK:** @@ -57,7 +56,6 @@ Here are the detailed instructions for running the generated API Dash code in C# dotnet --version ``` - #### Linux: 1. **Install .NET SDK:** - Run the following commands based on your distribution: @@ -76,7 +74,7 @@ Here are the detailed instructions for running the generated API Dash code in C# dotnet --version ``` -### 2. Preparing HttpClient +### 2. Preparing a Project #### In Visual Studio: 1. **Create a New Project:** @@ -105,9 +103,6 @@ Once you have .NET(C#) and `HttpClient` installed, follow these steps to execute 2. **Copy the generated code** 📋 from API Dash. 3. **Paste the code** into your project. ex) prgoram.cs - -### 4. Running the Project - #### In Visual Studio: 1. Click the **Start Debugging (F5)** button from the top menu to run the project. 2. The output window will display the API response. @@ -118,10 +113,6 @@ Once you have .NET(C#) and `HttpClient` installed, follow these steps to execute dotnet run ``` - - - - ## C# (RestSharp) TODO