Skip to content

Commit 26a80e5

Browse files
committed
Add instructions for API Dash-generated code in csharp(HttpClient)
1 parent 8167db5 commit 26a80e5

File tree

1 file changed

+78
-1
lines changed

1 file changed

+78
-1
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,84 @@ TODO
4343

4444
## C# (HttpClient)
4545

46-
TODO
46+
Here are the detailed instructions for running the generated API Dash code in C# (using `HttpClient`) for macOS, Windows, and Linux:
47+
48+
49+
### 1. Setting Up the C# Development Environment
50+
#### macOS and Windows:
51+
1. **Install .NET SDK:**
52+
- Visit the [official .NET download page](https://dotnet.microsoft.com/download).
53+
- Download and install the latest .NET SDK for macOS.
54+
2. **Verify Installation:**
55+
- Open the terminal and run the following command to verify the installation:
56+
```bash
57+
dotnet --version
58+
```
59+
60+
61+
#### Linux:
62+
1. **Install .NET SDK:**
63+
- Run the following commands based on your distribution:
64+
- For Ubuntu/Debian-based systems:
65+
```bash
66+
sudo apt update
67+
sudo apt install dotnet-sdk-7.0
68+
```
69+
- For Fedora/CentOS-based systems:
70+
```bash
71+
sudo dnf install dotnet-sdk-7.0
72+
```
73+
2. **Verify Installation:**
74+
- Open the terminal and run the following command to verify the installation:
75+
```bash
76+
dotnet --version
77+
```
78+
79+
### 2. Preparing HttpClient
80+
81+
#### In Visual Studio:
82+
1. **Create a New Project:**
83+
- Open Visual Studio and select **Create a new project**.
84+
- Choose the **Console Application (.NET Core)** template and create the project.
85+
86+
2. **Check `System.Net.Http` Namespace:**
87+
- `HttpClient` is included by default. No additional installation is required.
88+
89+
#### Using the CLI:
90+
1. **Create a Project:**
91+
```bash
92+
dotnet new console -n HttpClientExample
93+
cd HttpClientExample
94+
```
95+
96+
2. **Install the Package (if necessary):**
97+
```bash
98+
dotnet add package System.Net.Http
99+
```
100+
101+
### 3. Execute the generated code:
102+
Once you have .NET(C#) and `HttpClient` installed, follow these steps to execute the generated code:
103+
104+
1. **Open a IDE/text editor** ✍️ (Visual Studio, VS Code or any other text editor).
105+
2. **Copy the generated code** 📋 from API Dash.
106+
3. **Paste the code** into your project. ex) prgoram.cs
107+
108+
109+
### 4. Running the Project
110+
111+
#### In Visual Studio:
112+
1. Click the **Start Debugging (F5)** button from the top menu to run the project.
113+
2. The output window will display the API response.
114+
115+
#### Using the CLI:
116+
1. Open the terminal at the project root directory and run the following command:
117+
```bash
118+
dotnet run
119+
```
120+
121+
122+
123+
47124

48125
## C# (RestSharp)
49126

0 commit comments

Comments
 (0)