littlebigtomatoes

Design.Create.Smile.

How to Generate Typescript Classes From C# Like a Pro

| Comments

I will teach you how to create Typescript classes from your existing C# classes effortlessly like a pro within 30 seconds.

Sometimes, you will need to create typescript classes where the class already exists in C#. This is super boring and tedious, but here is a cool plugin to help you.

First you will need to install this plugin called TypescriptSyntaxPaste in Visual Studio.NET 2015.

Animated git showing how to install TypeScriptSyntaxPage plugin in Visual Studio.NET 2015

Installing it

  • Go to Tools | Extensions in Visual Studio .NET 2015.
  • Select Visual Studio Gallery under the Online category.
  • Search for TypescriptSyntaxPaste in the search folder.
  • Find the plugin in the results pane and click on Download.
  • Then click Install.
  • Restart Visual Studio.

Using it

After installing the plugin this is how you use it:

Animated git showing how to use TypeScriptSyntaxPage plugin in Visual Studio.NET 2015

  • Select your C# class and press Ctrl-C to copy.
  • Open a Typescript file (.ts or .tsx extension will work).
  • Paste the code.
  • Observe the results.

Enjoy!

Comments