从哪里读类库键/的WebAPI [英] from where to read keys in Class library/webapi

查看:149
本文介绍了从哪里读类库键/的WebAPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用缓存library.I现在用的缓存持续时间被缓存library.My问题内部使用的一个重点项目的WebAPI什么是我应该在哪里放缓存持续关键标准的做法,从凡挑缓存持续时间的价值,内部缓存库的AppConfig或的WebAPI的web.config文件?

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?

推荐答案

在web.config是一个Web应用程序的地方去。有作为一个ASP.NET应用程序的app.config没有这样的事情。你总是可以建立一些机制,从定制地方加载配置数据,但开发者将寻找这样的事情首先是web.config中。

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.

这篇关于从哪里读类库键/的WebAPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆