C#在WebApi 中使用Redis 的方法
2024-08-22 14:31:52
首先Startup
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
// For redis
// install-package Microsoft.Extensions.Caching.Redis
services.AddDistributedRedisCache(options =>
{
options.InstanceName = Configuration.GetConnectionString("RedisName");;
options.Configuration = Configuration.GetConnectionString("RedisConnection");
});
}
最新文章
- 【跟着子迟品 underscore】如何优雅地写一个『在数组中寻找指定元素』的方法
- (转)ant 使用指南
- ThinkPHP5 隐藏接口里面的index.php
- Codeforces Round #247 (Div. 2) B - Shower Line
- 第二章 Background &; Borders 之 Multiple borders
- POJ 1573 Robot Motion
- 自定义实现MPVolumeView音量控件
- myeclipse、eclipse去掉无用的workSpace
- 【DOS】这个命令太牛逼了
- [Python Study Notes]批量将ppt转换为pdf v1.0
- Python中capitalize()与title()的区别
- git清空版本记录
- MVC过滤器使用方法
- sqlserver 分割字符串和调用
- parson json解析
- Scala进阶之路-为什么要学习Scala以及开发环境搭建
- auto function ->; return type 当不能从{}内推断类型时
- 1A2B猜数字
- [SQL Server 2014] SQL Server 2014新特性探秘
- 项目中开机自启动的 node-webkit开机自启动
热门文章
- 网络 TCP三次握手,四次挥手详解
- Linux远程管理命令
- mysql数据库优化实战--日期及IP地址的正确存储方式
- Java对象深拷贝浅拷贝总结
- Build step 'Send files or execute commands over SSH' changed build result to UNSTABLE
- [unity]GPU Instance学习
- windows下pyinstaller打包踩坑记录
- spring的事务传播行为与隔离级别
- Vue通过WebSocket建立长连接
- src属性与浏览器渲染