How to create enum dynamically?

后端 未结 4 547
感情败类
感情败类 2021-01-17 09:47

I need to create an enum based on a table from the database.

DB table MyColors: id/title/value 1/Red/1 2/Green/4

dynamic create

enum          


        
4条回答
  •  迷失自我
    2021-01-17 10:29

    One option to is to define an XML Schema and the required values as enum and generate the class files, so that we can manage the values outside the source code, however we cannot dynamically generate the enum values from the database.

提交回复
热议问题