I'm looking for some sort of T4 or similar way to take C# classes and generate both the interfaces for the data that will come across the wire AND the view models in a strongly typed fashion.
I found typelite which works well for interfaces, but I'm looking for something that will handle the viewmodels too (or in addition to)
I found this project that seems excellent: Code Project View Models to JS
But of course it generates javascript and it looks non-trivial to hack in typing including things like enums, and inheritence etc. and make it work with typescript
Does anyone know of a project to do this?
If not, any tips on how to build this? I'm no T4 expert and it looks fairly impenitrible even with tools to make T4 editing less bad in Visual Studio.
Thanks!
I did this T4 to make my DTO contracts available from javascript, maybe it can help you
It outputs a js looking like this
Note that it has a dependency to a Tangible T4 Editor template