This is an interesting idea! I can, of course, understand the motivation. A good solution would be to create a javascript file from your C # models using the T4 templating engine .
This way you can create a template that uses reflection to capture all the types defined in a particular project or namespace and iterate over them by writing out a javascript definition for each. A little more reflection for listing public property names and any javascript syntax that you would like to surround and you are all sorted!
source share