from where to read keys in Class library/webapi

2019-07-25 05:50发布

i have a webapi project that uses cache library.I am using cache duration key that is used inside cache library.My question is what is the standard practice where should i put Cache duration key,from Where to pick the value of cache duration, inside appconfig of cache library or from web.config of webapi?

1条回答
Summer. ? 凉城
2楼-- · 2019-07-25 06:15

The web.config is the place to go in a web application. There's no such thing as app.config in an ASP.NET application. You could always build some mechanism to load configuration data from custom places but the first place a developer would look for such things is the web.config.

查看更多
登录 后发表回答