We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Is it possible to convert this
MyStaticClass.cs
public static class MyStaticClass { public static readonly string Property1 = "Property1"; public static readonly string Property2 = "Property2"; }
to
myEnums.ts
export enum MyStaticClass { Property1 = "Property1", Property2 = "Property2", }
?
Thank you!
The text was updated successfully, but these errors were encountered:
Instead of using a C# class use a C# enum with the TsEnum UseString option.
[TsEnum(UseString = true)] public enum MyEnum { Property1, Property2 }
This will generate your desired TypeScript enum. To access the string equivilant of the enum in C# simply use the ToString funciton.
MyEnum.Property1.ToString()
Sorry, something went wrong.
Is there a way to allow more flexibility in naming conventions for enums? What if I have property value such as "x-my-http-header"?
No branches or pull requests
Hi,
Is it possible to convert this
MyStaticClass.cs
to
myEnums.ts
?
Thank you!
The text was updated successfully, but these errors were encountered: