Closed CADBIMDeveloper closed 1 year ago
Hi @Elringus ,
There is a problem with exposing .Net enums to the TypeScript. For example, I have an enum in C# code like:
public enum Severity { Warning = 1, Error = 2 }
Values are missed when it's translated into TS like:
export enum Severity { Warning, Error }
Moreover, when I try to pass this like that:
dotnet.Something.someFunction({ severety: SomeNamespace.Severity.Error });
it fails with serialization exception, so I have to pass it like
dotnet.Something.someFunction({ severety: 2 });
I can try to prepare a PR to fix that, but want to discuss the details first
Check this: https://github.com/Elringus/DotNetJS#json-serializer-options
Thanks, will take a look
This issue is stale because it has been open 14 days with no activity. It will be automatically closed in 7 days.
Hi @Elringus ,
There is a problem with exposing .Net enums to the TypeScript. For example, I have an enum in C# code like:
Values are missed when it's translated into TS like:
Moreover, when I try to pass this like that:
it fails with serialization exception, so I have to pass it like
I can try to prepare a PR to fix that, but want to discuss the details first