WckdRzr.CSharpExporter 0.1.14

Suggested Alternatives

WckdRzr.Gaspar

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package WckdRzr.CSharpExporter --version 0.1.14
NuGet\Install-Package WckdRzr.CSharpExporter -Version 0.1.14
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WckdRzr.CSharpExporter" Version="0.1.14" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WckdRzr.CSharpExporter --version 0.1.14
#r "nuget: WckdRzr.CSharpExporter, 0.1.14"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WckdRzr.CSharpExporter as a Cake Addin
#addin nuget:?package=WckdRzr.CSharpExporter&version=0.1.14

// Install WckdRzr.CSharpExporter as a Cake Tool
#tool nuget:?package=WckdRzr.CSharpExporter&version=0.1.14

C# Exporter

This is a tool that consumes your C# domain models, types and controllers and exports them for other services and languages to consume. Your C# models are available in TypeScript and your controller endpoints are available to TypeScript and other C# services, removing the need to hard code variable names and urls.

It's built from Jonathan Svenheden's C# models to TypeScript project which makes use of the Roslyn (the .NET compiler platform) to parse the source files, which removes the need to create and maintain our own parser.

Supported Conversions

C# Models and Types C# Controllers
Export to TypeScript
Export to Angular
Export to Ocelot Config
Export to C#

Dependencies

Install

Install from NuGet: https://www.nuget.org/packages/WckdRzr.CSharpExporter/

How to use

  1. Add a config file to your project named csharp-exporter.config that contains for example (See /Models/Configuration.cs for the full config model)...
{
	"Models": {
		"Include": [
			"./Models/**/*.cs",
            "./Enums/**/*.cs"
		],
		"Exclude": [
            "./Models/foo/bar.cs"
        ],
	    "Output": [{
			"Type": "TypeScript",
	    	"Location": "./api.d.ts"
	    },{
			"Type": "CSharp",
	    	"Location": "./ServiceComms/Api.cs"
		}],
		"CamelCaseEnums": false,
		"NumericEnums": true,
		"StringLiteralTypesInsteadOfEnums": false
	},
	"Controllers": {
		"Include": [
			"./Controllers/**/*.cs",
		],
		"Exclude": [],
		"Output": [{
			"Type": "Angular",
			"Location": "./service.ts",
			"ModelPath": "./api.d"
		}],
	    "Gateway": "api",
	    "ServiceName": "all"
	},
    "OnlyWhenAttributed": "FrontEnd",
    "CustomTypeTranslations": {
        "ProductName": "string",
        "ProductNumber": "string"
    }
}
  1. Add a NuGet script to your project.

  2. Build. The output files will be created.

License

MIT © Wckd Rzr

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated