How compiler handles string interpolation

后端 未结 1 974
庸人自扰
庸人自扰 2021-01-22 03:20

I am using string interpolation for a method attribute like -

const string User = \"SomeUser\";
const string Admin = \"Admin\";
.
.
.
[Authorize(Roles = $\"{User         


        
相关标签:
1条回答
  • 2021-01-22 03:43

    string interpolation is converted to string.Format which isn't a compile time constant as it requires kindly review this question for more information

    0 讨论(0)
提交回复
热议问题