Skip to content

Commit e4c9ae2

Browse files
Add C# code snippets to retries documentation
Co-Authored-By: Niels Swimberghe <[email protected]>
1 parent 14aa465 commit e4c9ae2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

fern/products/sdks/guides/retries-with-backoff.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ default retry limit when instantiating the client.
6868
)
6969
```
7070
</CodeBlock>
71+
<CodeBlock title="C#">
72+
```csharp {3}
73+
using Imdb;
74+
75+
var client = new ImdbClient(new ClientOptions {
76+
MaxRetries = 1 // overrides the default retry limit to 1
77+
});
78+
```
79+
</CodeBlock>
7180
</CodeBlocks>
7281

7382
It's also possible to override the retry limit on a per-request basis.
@@ -103,5 +112,12 @@ It's also possible to override the retry limit on a per-request basis.
103112
)
104113
```
105114
</CodeBlock>
115+
<CodeBlock title="C#">
116+
```csharp {2}
117+
var movie = await client.Movie.GetAsync("tt0111161", new RequestOptions {
118+
MaxRetries = 3 // overrides the default retry limit to 3
119+
});
120+
```
121+
</CodeBlock>
106122
</CodeBlocks>
107123

0 commit comments

Comments
 (0)