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.TableName = "Sessions";
|
||||
//});
|
||||
#if NET451
|
||||
|
||||
// Uncomment the following line to use the Redis implementation of IDistributedCache.
|
||||
// This will override any previously registered IDistributedCache service.
|
||||
//services.AddSingleton<IDistributedCache, RedisCache>();
|
||||
#endif
|
||||
//services.AddDistributedRedisCache(o =>
|
||||
//{
|
||||
// o.Configuration = "localhost";
|
||||
// o.InstanceName = "SampleInstance";
|
||||
//});
|
||||
|
||||
services.AddSession(o =>
|
||||
{
|
||||
o.IdleTimeout = TimeSpan.FromSeconds(10);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*",
|
||||
"Microsoft.AspNetCore.Session": "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.Logging.Console": "1.1.0-*"
|
||||
},
|
||||
|
|
@ -16,11 +17,7 @@
|
|||
]
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Caching.Redis": "1.1.0-*"
|
||||
}
|
||||
},
|
||||
"net451": {},
|
||||
"netcoreapp1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue