Skip to content

Commit 3b4ceb6

Browse files
authored
Merge pull request #543 from FreeBono/add-restsharp-doc
Add instructions for API Dash-generated code in csharp(RestSharp)
2 parents b2c61e9 + 2a6dbe5 commit 3b4ceb6

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,82 @@ Once you have .NET(C#) and `HttpClient` installed, follow these steps to execute
115115

116116
## C# (RestSharp)
117117

118-
TODO
118+
Here are the detailed instructions for running the generated API Dash code in C# (using RestSharp) for macOS, Windows, and Linux:
119+
120+
### 1. Setting Up the C# Development Environment
121+
122+
#### macOS and Windows
123+
1. **Install .NET SDK**
124+
- Visit the [official .NET download page](https://dotnet.microsoft.com/download).
125+
- Download and install the latest .NET SDK for macOS.
126+
2. **Verify Installation**
127+
- Open the terminal and run the following command to verify the installation:
128+
```bash
129+
dotnet --version
130+
```
131+
132+
#### Linux
133+
1. **Install .NET SDK**
134+
- Run the following commands based on your distribution:
135+
- For Ubuntu/Debian-based systems:
136+
```bash
137+
sudo apt update
138+
sudo apt install dotnet-sdk-7.0
139+
```
140+
- For Fedora/CentOS-based systems:
141+
```bash
142+
sudo dnf install dotnet-sdk-7.0
143+
```
144+
2. **Verify Installation**
145+
- Open the terminal and run the following command to verify the installation:
146+
```bash
147+
dotnet --version
148+
```
149+
150+
### 2. Preparing a Project
151+
152+
#### In Visual Studio
153+
154+
1. **Create a New Project**
155+
- Open Visual Studio and select **Create a new project**.
156+
- Choose the **Console Application (.NET Core)** template and create the project.
157+
158+
2. **Install `RestSharp`**
159+
- Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
160+
- Under the Browse tab, search for `RestSharp` and install it.
161+
162+
#### Using the CLI
163+
164+
1. **Create a Project**
165+
```bash
166+
dotnet new console -n RestSharpExample
167+
cd RestSharpExample
168+
```
169+
170+
2. **Install the Package**
171+
```bash
172+
dotnet add package RestSharp
173+
```
174+
175+
### 3. Execute the generated code
176+
177+
Once you have .NET(C#) and `RestSharp` installed, follow these steps to execute the generated code:
178+
179+
1. Open a IDE/text editor (Visual Studio, VS Code or any other text editor).
180+
2. Copy the generated code from API Dash.
181+
3. Paste the code into your project like program.cs
182+
183+
#### In Visual Studio
184+
185+
1. Click the **Start Debugging (F5)** button from the top menu to run the project.
186+
2. The output window will display the API response.
187+
188+
#### Using the CLI
189+
190+
1. Open the terminal at the project root directory and run the following command:
191+
```bash
192+
dotnet run
193+
```
119194

120195
## Dart (http)
121196

0 commit comments

Comments
 (0)