Can you add to an enum type in run-time

后端 未结 6 629
甜味超标
甜味超标 2020-12-08 07:06

If I have an enum type:

public enum Sport
{
    Tennis = 0;
    Football = 1;
    Squash = 2;
    Volleyball = 3;
}

Can I somehow add durin

6条回答
  •  囚心锁ツ
    2020-12-08 07:32

    No, you cannot modify types at runtime. You could emit new types, but modifying existing ones is not possible.

提交回复
热议问题