Base solution for your next web application
Open Closed

dto enum names in frontend #7758


User avatar
0
daws created

I have a dto with an enum property :

public MyEnumType MyProperty { get; set; }

with MyEnumType :

public enum MyEnumType { Undefined = 0, First = 1, Second = 2, }

In the service-proxies however, my enum is translated like this :

export enum MyEnumType { _0 = 0, _1 = 1, _2 = 2, }

Is there a way to have access to the string names of an enum in the frontend ?

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team
    • What is your product version?
    • What is your product type (Angular or MVC)?
    • What is product framework type (.net framework or .net core)?

    This commit seems to solve this problem.

    https://github.com/aspnetzero/aspnet-zero-core/commit/f8a037beb901a1faad56f6058f5a99ad56fa25dd#diff-95b60e9b66067387865beebdd219fadbR11078

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    daws created

    Currently abp zero 6.4 with Angular and .net framework but we are now in the process of migrating to 7.2.3 so our problem will likely be solved.

    Thank you.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)