{"action":"created","issue":{"url":"https://api.github.com/repos/madskristensen/WebEssentials2013/issues/1857","labels_url":"https://api.github.com/repos/madskristensen/WebEssentials2013/issues/1857/labels{/name}","comments_url":"https://api.github.com/repos/madskristensen/WebEssentials2013/issues/1857/comments","events_url":"https://api.github.com/repos/madskristensen/WebEssentials2013/issues/1857/events","html_url":"https://github.com/madskristensen/WebEssentials2013/issues/1857","id":75747359,"number":1857,"title":"Create Typescript intellisense problems","user":{"login":"lucamorelli","id":127777,"avatar_url":"https://avatars.githubusercontent.com/u/127777?v=3","gravatar_id":"","url":"https://api.github.com/users/lucamorelli","html_url":"https://github.com/lucamorelli","followers_url":"https://api.github.com/users/lucamorelli/followers","following_url":"https://api.github.com/users/lucamorelli/following{/other_user}","gists_url":"https://api.github.com/users/lucamorelli/gists{/gist_id}","starred_url":"https://api.github.com/users/lucamorelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucamorelli/subscriptions","organizations_url":"https://api.github.com/users/lucamorelli/orgs","repos_url":"https://api.github.com/users/lucamorelli/repos","events_url":"https://api.github.com/users/lucamorelli/events{/privacy}","received_events_url":"https://api.github.com/users/lucamorelli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-12T21:34:37Z","updated_at":"2015-05-20T05:53:53Z","closed_at":null,"body":"Hi,\r\n  I was trying to use the Create Typescript Intellisense file features, but I'm finding a bit difficult to use extensively in some situation and I was thinking to add a few features:\r\n1. **camelCasing of the properties** exposed in the typescript class. serializing and deserializing via  mvc action sometimes the data are not correctly bound, so I would like to expose this as an option, with the other option of convert them unchanged.\r\n2. **exposing the generated entities as interfaces**. I can use them from typescript client side but I haven't found a way to create a new instance using the new operator: I have to write\r\n    var myObject = { prop1= 1, prop2 .....} giving a value for each property untils typescript is happy, and this is a bit annoying when the class has a lot of properties. To have the option to generate as class may be of help in some situation I think\r\n3. if a class contains inside an instance of another object this is not converted and is defined as myProP : {}, and this limits intellisense when you have contained classes..\r\n4. Use of the **TypescriptModule** attribute for every class, this is a limitation if I want to compile contained objects.\r\n\r\nFor the first 2 points the solution is not complicated, but to solve the last two I though a different approach:\r\n1. choose a folder inside the project (ApiModels for examples ).\r\n2. every csharp class inside this folder ot subfolder is automatically converted to ts assigning the namespace as module name.\r\n3. now that we're sure that every class is available as ts when can add inner references inside classes, and if optionally add a prefix if someone doesn't like to have the same name.\r\n4. add an helper class for the entities when, using Automapper you can fix the serialization issues (for example I often have problems serializing and deserializing dates).\r\n\r\nWhat do you think? May be a nice idea? "},"comment":{"url":"https://api.github.com/repos/madskristensen/WebEssentials2013/issues/comments/103770312","html_url":"https://github.com/madskristensen/WebEssentials2013/issues/1857#issuecomment-103770312","issue_url":"https://api.github.com/repos/madskristensen/WebEssentials2013/issues/1857","id":103770312,"user":{"login":"am11","id":3840695,"avatar_url":"https://avatars.githubusercontent.com/u/3840695?v=3","gravatar_id":"","url":"https://api.github.com/users/am11","html_url":"https://github.com/am11","followers_url":"https://api.github.com/users/am11/followers","following_url":"https://api.github.com/users/am11/following{/other_user}","gists_url":"https://api.github.com/users/am11/gists{/gist_id}","starred_url":"https://api.github.com/users/am11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/am11/subscriptions","organizations_url":"https://api.github.com/users/am11/orgs","repos_url":"https://api.github.com/users/am11/repos","events_url":"https://api.github.com/users/am11/events{/privacy}","received_events_url":"https://api.github.com/users/am11/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T05:53:53Z","updated_at":"2015-05-20T05:53:53Z","body":"Undoubtedly, this is a nice suggestion.\r\n\r\nThere are some mature tools such as [TypeScripter](http://cjlpowers.github.io/TypeScripter/) and [TypeLite](http://type.litesolutions.net/) for C#-TS conversions, which even generate interface definitions from compiled assemblies. Compared to these tools, WE2013's implementation is quite basic. \r\n\r\nWE uses reflection to enumerate the code. For casing fixes, they can be delivered without much hassle. The rest of them are doable as well, but TBH, the development experience is not super-pleasant (hint: it is Reflection all over the place!)\r\n\r\nIn WE2015 (https://github.com/madskristensen/WebEssentials2015), however, typescript conversion can leverage [Roslyn](http://github.com/dotnet/roslyn/). With that, the chances of getting this entire feature on steroids are quite high and we can advance pretty swiftly.\r\n\r\nIMO, since both versions of WE are implementing this feature using different approaches, we should first implement in WE2015 using Roslyn, and then for VS 2013 (where Roslyn can be optionally installed), back-port the code to WE2013 with a runtime check if Roslyn not present, show dependency missing notification in menu/option for \"advance features\". This will save duplicate effort and save a lot of development time figuring out what is and isn't possible with Reflection, which can be better spent on perfecting our Roslyn :muscle:."}}