Update sample to include Redis for Core (#128)
This commit is contained in:
parent
8f10080ad0
commit
295d419265
|
|
@ -30,11 +30,15 @@ namespace SessionSample
|
||||||
// o.SchemaName = "dbo";
|
// o.SchemaName = "dbo";
|
||||||
// o.TableName = "Sessions";
|
// o.TableName = "Sessions";
|
||||||
//});
|
//});
|
||||||
#if NET451
|
|
||||||
// Uncomment the following line to use the Redis implementation of IDistributedCache.
|
// Uncomment the following line to use the Redis implementation of IDistributedCache.
|
||||||
// This will override any previously registered IDistributedCache service.
|
// This will override any previously registered IDistributedCache service.
|
||||||
//services.AddSingleton<IDistributedCache, RedisCache>();
|
//services.AddDistributedRedisCache(o =>
|
||||||
#endif
|
//{
|
||||||
|
// o.Configuration = "localhost";
|
||||||
|
// o.InstanceName = "SampleInstance";
|
||||||
|
//});
|
||||||
|
|
||||||
services.AddSession(o =>
|
services.AddSession(o =>
|
||||||
{
|
{
|
||||||
o.IdleTimeout = TimeSpan.FromSeconds(10);
|
o.IdleTimeout = TimeSpan.FromSeconds(10);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*",
|
||||||
"Microsoft.AspNetCore.Session": "1.1.0-*",
|
"Microsoft.AspNetCore.Session": "1.1.0-*",
|
||||||
"Microsoft.Extensions.Caching.Memory": "1.1.0-*",
|
"Microsoft.Extensions.Caching.Memory": "1.1.0-*",
|
||||||
|
"Microsoft.Extensions.Caching.Redis": "1.1.0-*",
|
||||||
"Microsoft.Extensions.Caching.SqlServer": "1.1.0-*",
|
"Microsoft.Extensions.Caching.SqlServer": "1.1.0-*",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.1.0-*"
|
"Microsoft.Extensions.Logging.Console": "1.1.0-*"
|
||||||
},
|
},
|
||||||
|
|
@ -16,11 +17,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": {
|
"net451": {},
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.Extensions.Caching.Redis": "1.1.0-*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue