DTO以打字稿发生器 [英] DTO to TypeScript generator

查看:119
本文介绍了DTO以打字稿发生器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含了一组的DTO的,我用它来填充我的淘汰赛模型(打字稿)一个C#库(组装)。

I have a C# library (assembly) which contains a set of DTOs which I use to populate my knockout models (typescript).

我想,以确保该JSON数据和视图模型之间的映射是正确的。

I would like to make sure that the mapping between the JSON data and the ViewModel is correct.

是否有一个工具,它可以从我的C#类产生打字稿类?像T4或同级(或只是一个命令行工具,可以在运行作为后生成事件)?

Are there a tool which can generate typescript classes from my c# classes? Something like T4 or similar (or just a command line tool which is run as a POST-build event)?

(千万注意,打字稿文件必须放置在另一项目比DTO组装)

(do note that the typescript files must be placed in another project than the DTO assembly)

推荐答案

是啊看看这个优秀的项目TypeLITE:的http://type.litesolutions.net/

Yup check out this excellent project TypeLITE : http://type.litesolutions.net/

这篇关于DTO以打字稿发生器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆