Adding literals to an existing Enum at runtime

G

Guest

I have seen an example of how to create a new Enum at runtime using
EnumBuilder.

However, I was wondering if I could add literals to an existing Enum at
runtime ?
 
M

Mattias Sjögren

However, I was wondering if I could add literals to an existing Enum at
runtime ?

No, you can't change existing types at runtime, whether or not they
are enums.

Why do you want to do that anyway? Since enum members are constants,
they are mostly used at compile time.



Mattias
 
G

Guest

I agree.
I actually wanted to explore all options to somehow synch my enums with the
DB.
The only way would be to run an emitter exe periodically to generate an
assembly.
The emitter exe would fetch the values from the DB and generate appropriate
enums.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top