从配置文件中读取属性参数值

Tom*_*mas 5 c# custom-attributes

是否可以从配置文件加载属性值?例如,我的属性下面有缓存属性返回值.该属性在应用程序中使用了10次以上,我想从配置文件中加载第二个属性参数(1800秒).

[Cache(CacheType.Absolute, 1800, CacheLocation.Memory)]
Run Code Online (Sandbox Code Playgroud)

Ari*_*ian -1

Attributes我认为你可以通过这样写来做到这一点:

如何创建自定义数据注释验证器