From 36d35cbf0b7cc1d47172b5c8b7953fcc087380dc Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Tue, 8 Jul 2025 12:35:39 -0400 Subject: [PATCH] add c#/.net quickstart --- .../sdks/overview/dotnet/quickstart.mdx | 89 ++++++++++++++++++- 1 file changed, 87 insertions(+), 2 deletions(-) diff --git a/fern/products/sdks/overview/dotnet/quickstart.mdx b/fern/products/sdks/overview/dotnet/quickstart.mdx index 4668466bf..72fc22288 100644 --- a/fern/products/sdks/overview/dotnet/quickstart.mdx +++ b/fern/products/sdks/overview/dotnet/quickstart.mdx @@ -3,6 +3,91 @@ title: .NET Quickstart description: Get started quickly with the Fern .NET SDK. --- -# .NET Quickstart + -Follow these steps to quickly get up and running with the Fern .NET SDK. \ No newline at end of file +Generate a C#/.NET SDK by following the instructions on this page. + + + + + ### Initialize the Fern Folder + + You can use either the OpenAPI definition, AsyncAPI definition, or Fern + Definition to generate your SDK. + + + + + + + + + + + 2. Add the config option `outputSourceFiles: true` to + `generators.yml`. This ensures your SDK contains source files in + your preferred SDK language instead of compiled output. + + ```yaml {11-12} + # yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json + default-group: local + groups: + local: + generators: + - name: fernapi/fern-typescript-node-sdk + output: + location: local-file-system + path: ../sdks/typescript + version: + config: + outputSourceFiles: true + ``` + + `fern init` creates a default configuration that includes the + TypeScript Node SDK generator. The `local` group containing this + generator only generates if you run fern generate without specifying a + group, or if you explicitly target it with `fern generate --group + local`. In subsequent steps, you'll add an additional generator for your + preferred SDK language. + + + + + + +### Add the SDK generator + +Add the C#/.NET SDK generator: + +```bash +fern add fern-csharp-sdk --group sdk +``` + +This command adds the following to `generators.yml`: + +```yaml + sdk: + generators: + - name: fernapi/fern-csharp-sdk + version: + output: + location: local-file-system + path: ../sdks/csharp +``` + + + +```bash +fern/ # created in step 1 +sdks/ # created by fern generate --group sdk +├─ csharp + └─ src/ + ├─ YourOrganizationApi.sln + ├─ YourOrganizationApi/ + ├─ Imdb/ # or the name of your API + └─ Core/ + └─ YourOrganizationApi.Test/ + ├─ Utils/ + └─ Core/ +``` +