【发布时间】:2020-06-09 08:43:24
【问题描述】:
为什么 Authorize Attribute 策略参数被限制为 const "compile time" ?
因为这个限制不允许像下面的例子那样使用字符串连接,所以有任何理由限制它。
[Authorize($"{Privilege1},{Privilege2}")]
[HttpPost()]
public async Task<IActionResult> Testpost()
{
return Ok();
}
【问题讨论】:
标签: asp.net .net asp.net-core .net-framework-version asp.net-apicontroller