Skip to content

Commit c845aa6

Browse files
committed
Add instructions for API Dash-generated code in csharp(RestSharp)
1 parent 5739c3f commit c845aa6

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

doc/user_guide/instructions_to_run_generated_code.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,50 @@ 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+
### 1. Setting Up the C# Development Environment
120+
121+
Check out the instructions [here](#1-setting-up-the-c-development-environment) for detailed steps on how to set C# Development Environment on macOS, Windows, or Linux.
122+
123+
### 2. Preparing a Project
124+
125+
#### In Visual Studio:
126+
1. **Create a New Project:**
127+
- Open Visual Studio and select **Create a new project**.
128+
- Choose the **Console Application (.NET Core)** template and create the project.
129+
130+
2. **Install `RestSharp`**
131+
- Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
132+
- Under the Browse tab, search for `RestSharp` and install it.
133+
134+
#### Using the CLI:
135+
1. **Create a Project:**
136+
```bash
137+
dotnet new console -n RestSharpExample
138+
cd RestSharpExample
139+
```
140+
141+
2. **Install the Package:**
142+
```bash
143+
dotnet add package RestSharp
144+
```
145+
146+
### 3. Execute the generated code:
147+
Once you have .NET(C#) and `RestSharp` installed, follow these steps to execute the generated code:
148+
149+
1. **Open a IDE/text editor** ✍️ (Visual Studio, VS Code or any other text editor).
150+
2. **Copy the generated code** 📋 from API Dash.
151+
3. **Paste the code** into your project. ex) prgoram.cs
152+
153+
#### In Visual Studio:
154+
1. Click the **Start Debugging (F5)** button from the top menu to run the project.
155+
2. The output window will display the API response.
156+
157+
#### Using the CLI:
158+
1. Open the terminal at the project root directory and run the following command:
159+
```bash
160+
dotnet run
161+
```
119162

120163
## Dart (http)
121164

0 commit comments

Comments
 (0)