I am just going to start use TypeScript
in my HTML client project which belongs to a MVC project with a entity framework domain model already there. I want my two projects (client side and server side) totally separated as two teams will work on this... JSON and REST is used to communicate objects back and forth.
Of course, my domain
objects on the client side should match the objects on the server side. In the past, I have normally done this manually. Is there a way to reuse my C# class definitions (specially of the POJO
classes in my domain model) to create the corresponding classes in TypeScript"?
There is not currently anything that will map C# to TypeScript. If you have a lot of POCOs or you think they might change often, you could create a converter - something simple along the lines of...
public class MyPoco {
public string Name { get; set; }
}
To
export class MyPoco {
public Name: string;
}
There is also a discussion on Codeplex about auto-generating from C#.
Just to keep things updated, TypeLite can generate TypeScript interfaces from C#: