diff --git a/samples/SessionSample/Startup.cs b/samples/SessionSample/Startup.cs index 8c65358399..1d98147980 100644 --- a/samples/SessionSample/Startup.cs +++ b/samples/SessionSample/Startup.cs @@ -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(); -#endif + //services.AddDistributedRedisCache(o => + //{ + // o.Configuration = "localhost"; + // o.InstanceName = "SampleInstance"; + //}); + services.AddSession(o => { o.IdleTimeout = TimeSpan.FromSeconds(10); diff --git a/samples/SessionSample/project.json b/samples/SessionSample/project.json index d73613027c..9729846107 100644 --- a/samples/SessionSample/project.json +++ b/samples/SessionSample/project.json @@ -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": {