gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 23:53:32 25 4
gpt4 key购买 nike

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

[Cache(CacheType.Absolute, 1800, CacheLocation.Memory)]

最佳答案

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

How to create Custom Data Annotation Validators

关于c# - 从配置文件中读取属性参数值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10186592/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com