Convert C# Models, ViewModels and DTOs into their TypeScript equivalents using webapps, CLI Tool or VSCode extension. Links: https://marketplace.visualstudio.com/items?itemName=adrianwilczynski.csharp-to-typescript - https://csharptotypescript.azurewebsites.net - https://adrianwilczynski.github.io/CSharpToTypeScript/ - https://www.nuget.org/packages/CSharpToTypeScript.CLITool/
So, for one, I'm not sure how it is useful to convert the casing. In my case, I'm converting Razor templates into Vue ones, and they have bindings into these constants, so it's a matter of converting '@Foo.AnotherConstant' to Foo.AnotherConstant, but the casing conversion would make that impossible.
Secondly, of course, the values are missing. I don't understand this kind of conversion because TypeScript has classes, and classes can be used as interfaces, so why isn't the output just:
export class Foo {
static AConstant = "A string constant";
static AnotherConstant = "Another string constant";
}
That would be a direct representation of the class.
We have C# files that define what looks like dictionaries?
That is, it has code like this:
This was converted by the plugin to a structure like this:
So, for one, I'm not sure how it is useful to convert the casing. In my case, I'm converting Razor templates into Vue ones, and they have bindings into these constants, so it's a matter of converting
'@Foo.AnotherConstant'
toFoo.AnotherConstant
, but the casing conversion would make that impossible.Secondly, of course, the values are missing. I don't understand this kind of conversion because TypeScript has classes, and classes can be used as interfaces, so why isn't the output just:
That would be a direct representation of the class.