简体   繁体   中英

Create javascript reference file of JSON object for intellisense

I am using C# to create a rather complicated data object that contains a couple of lists of objects that is then serialized and sent to the client. I like this approach a lot because I am using the same object definition in both my client and server side code.

I'd like to create some sort of reference file for Visual Studio 2012 so that intellisense can help me out, typos in my javascript code seem to be my biggest problem in debugging.

Does anybody have any tips for doing this? I understand that as I add new properties to the C# class I will need to refresh this reference file.

You can use T4 template to generate javascipt viewmodel file from your C# class.

Take a look at this article .

Also some more information available .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM