The C# SDK generator is now generally available, bringing high quality SDKs to the .NET ecosystem. Key highlights include:
.NET Standard 2.0 support: You can use Stainless C# SDKs in any environment that implements .NET Standard 2.0. For more information see the changelog.
File uploads & downloads: Full lazy upload and download support with simple casting from
Streamandbyte[], including using the file name if available or specifying one manually.Type conversions: Implicit conversions for union variants to keep instantiations clean while preserving full type information.
Tooling support: Great type-ahead within all modern C# editors.
Minimal dependencies: Packages are only used for back-porting .NET features, as well as for unit tests. Aside from xUnit.net, all packages are maintained by Microsoft.
Equality checking: All non-streaming types implement a custom
Equalsoverride, allowing for comparing arbitrarily complex objects.Streaming: Support for SSE and JSONL streams as C# async enumerables, allowing for convenient usage with LINQ.
Intelligent pagination: Paginated endpoints are exposed as async enumerables, and automatically request new pages as required.
Comprehensive unit tests: Unit tests are generated for all model types and service methods.
NuGet publishing: C# SDKs can be configured to be automatically published to NuGet on every release.
Strong name signing: Assemblies can be automatically compiled with a strong name.
Advanced use-cases: Raw and undocumented request support.
