- Posted On 13 April 2017
- By
- In Programming
This post is to introduce "Typewriter", extension for visual studio that generates TypeScript files from C# code files using TypeScript templates.
Using this awesome extension you can create fully typed TypeScript representations of server side API, models, controllers etc. By installing this extension you get TypeScript Intellisense and compile-time errors when the client- and server side code differs. This speeds up your development pace and increases the quality of your applications.
Just to give an practical intro, below is the example from the Typewriter site.
Suppose, If you add a CustomerModel class like below.
using System; using System.Collections.Generic; namespace Demo { public class CustomerModel { public int Id { get; set; } public string Name { get; set; } public ICollection<OrderModel> Orders { get; set; } } }
then CustomerModel.ts file gets created automatically like below
module App { export class CustomerModel { public id: number; public name: string; public orders: OrderModel[]; } }
Isn't this amazing and time saving?
For this you just need to define the template like below .tst file (this file gets used by typewriter to generate the TypeScript code.)
module App { $Classes(*Model)[ export class $Name { $Properties[ public $name: $Type;] }] }
Checkout many more other features here.
Do share your opinion in the comment section and don't forget to share this information with your friends using share buttons provided below.
- Tags :
- ASP.NET
- Technology
Top 10 Visual Studio things which can boost developers coding speed
Visual Studio 2012 provides some coding features by which you can code faster if use them properly. This post will cover top 10 things among them to boost your development speed.
Visual Studio 2008 Shell and TFS integration
Visual Studio 2008 Shell and TFS integration is the problem for all newbies of BIDS and TFS. Here is the solution.
Assembla - Free and private repository to manage your source code online with SVN subversion hosting
With Assembla you can share source code with others online. Free & Private source code repository with SVN Subversion, Git & Perforce Hosting.
How to call click or any event only once in jQuery
Know how to execute an click event or any event only once for any element in jQuery. Perform action only once and even not required to unbind event.
Best CSS Gradient background generator tools online
Here are some best CSS gradient background code generator online tools using which you can create a cross browser css code for gradient backgrounds.