简体   繁体   中英

Visual studio (2013) intellisense for C# parsed json object

I have an Asp.Net application, and I am trying to do as much as I can on client site. So, I am passing my C# objects serialized to JSON string to my clients (website with JavaScript) to have all information that I need.

Now on client side, I have no intellisense for the objects, because they are anonymous.

Is there something built-in, or a lib or extension, that could make my classes, or eg. classes that I mark with an attribute, available for intellisense in JavaScript.

  1. I mean, I could programmatically convert my C# classes to JSON and save them to a file after each build. But I don't know how thus then could be used for intellisense.

  2. I could also convert the C# classes to JavaScript classes, so that these are available in JavaScript for intellisense, but I think this is hard to convert because I would have to do it by hand.

As far as I know there is no easy way to share your C# classes with your javascript.

But as it sounds to me, you are looking for typescript. This is a type safe version of javascript created by Microsoft.

This should also give you way better intelisense for the code.

Check it out here:

https://www.typescriptlang.org/

https://en.wikipedia.org/wiki/TypeScript

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