TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

any c# to typescript compatible with asp.net 5?

Open lucamorelli opened this issue 11 years ago • 7 comments

Hi, I'm going to start a project with asp.net 5, angular 1 and typescript, and I would like to use some tool to convert c# models to typescript, but I don't find any running under asp.net 5. TypeLite uses a tt file that is not installed inside the project and I don't think can run. Is there something available? It is possible to convert the classes creating ts file compatible with the es6 import syntax for the references to other types?

lucamorelli avatar Nov 25 '15 21:11 lucamorelli

I know there's a utility call TypeLITE: TypeLITE is an utility, that generates TypeScript definitions from .NET classes. It supports all major features of the current TypeScript specification, including modules and inheritance. The library offers several extensibility points, so you can easily customize generated code.

reference http://type.litesolutions.net/

Hope this could help.

jimior2 avatar Nov 26 '15 05:11 jimior2

I already tried to install it, but looks like it's based on a tt file that is installed inside the script folder, and in asp.net 5 is not installed. Anyway, I don't think I can run .tt inside the scripi

lucamorelli avatar Nov 26 '15 06:11 lucamorelli

Look at https://github.com/BBGONE/jRIAppTS you can take the code from this folder https://github.com/BBGONE/JRIAppTS/tree/master/RIAppDemo/RIAPP.DataService/Utils/CodeGen

ghost avatar Nov 29 '15 17:11 ghost

thanks, I'm giving a look but remove all the dependencies to the framework code is a bit hard I think

lucamorelli avatar Dec 01 '15 05:12 lucamorelli

another option for you https://www.nuget.org/packages/Fonlow.Poco2Ts/ https://webapiclientgen.codeplex.com/wikipage?title=Fonlow.Poco2Ts

ghost avatar Dec 01 '15 08:12 ghost

thanks. Looks like this is better. I tried to scaffold an asp.net 5 library, but I receive the error that was unable to load entityframework.core. I suppose I should take the source and convert in asp.net 5 libraries to be able to work with asp.net 5. I'll give a try

lucamorelli avatar Dec 08 '15 08:12 lucamorelli

Just following up - any luck with this? I had tried a new approach based on Roslyn

https://github.com/nh43de/cstsd

nh43de avatar Jan 17 '18 04:01 nh43de