From d37f9dded2ed78a1fc51897ff3d56f172348a19c Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Thu, 16 Apr 2015 18:30:25 -0700 Subject: [PATCH] React to SessionCollectionExtensions renames React to aspnet/HttpAbstractions#280 --- samples/SessionSample/Startup.cs | 8 ++++---- .../SessionTests.cs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/SessionSample/Startup.cs b/samples/SessionSample/Startup.cs index 17f68de5ce..72132b69bd 100644 --- a/samples/SessionSample/Startup.cs +++ b/samples/SessionSample/Startup.cs @@ -31,8 +31,8 @@ namespace SessionSample subApp.Run(async context => { int visits = 0; - visits = context.Session.GetInt("visits") ?? 0; - context.Session.SetInt("visits", ++visits); + visits = context.Session.GetInt32("visits") ?? 0; + context.Session.SetInt32("visits", ++visits); await context.Response.WriteAsync("Counting: You have visited our page this many times: " + visits); }); }); @@ -40,7 +40,7 @@ namespace SessionSample app.Run(async context => { int visits = 0; - visits = context.Session.GetInt("visits") ?? 0; + visits = context.Session.GetInt32("visits") ?? 0; await context.Response.WriteAsync(""); if (visits == 0) { @@ -50,7 +50,7 @@ namespace SessionSample } else { - context.Session.SetInt("visits", ++visits); + context.Session.SetInt32("visits", ++visits); await context.Response.WriteAsync("Your session was located, you've visited the site this many times: " + visits); } await context.Response.WriteAsync(""); diff --git a/test/Microsoft.AspNet.Session.Tests/SessionTests.cs b/test/Microsoft.AspNet.Session.Tests/SessionTests.cs index 2316ff2ea9..be296185d9 100644 --- a/test/Microsoft.AspNet.Session.Tests/SessionTests.cs +++ b/test/Microsoft.AspNet.Session.Tests/SessionTests.cs @@ -75,14 +75,14 @@ namespace Microsoft.AspNet.Session app.UseInMemorySession(); app.Run(context => { - int? value = context.Session.GetInt("Key"); + int? value = context.Session.GetInt32("Key"); if (context.Request.Path == new PathString("/first")) { Assert.False(value.HasValue); value = 0; } Assert.True(value.HasValue); - context.Session.SetInt("Key", value.Value + 1); + context.Session.SetInt32("Key", value.Value + 1); return context.Response.WriteAsync(value.Value.ToString()); }); }, @@ -110,12 +110,12 @@ namespace Microsoft.AspNet.Session app.UseInMemorySession(); app.Run(context => { - int? value = context.Session.GetInt("Key"); + int? value = context.Session.GetInt32("Key"); if (context.Request.Path == new PathString("/first")) { Assert.False(value.HasValue); value = 0; - context.Session.SetInt("Key", 1); + context.Session.SetInt32("Key", 1); } else if (context.Request.Path == new PathString("/second")) { @@ -154,12 +154,12 @@ namespace Microsoft.AspNet.Session app.UseInMemorySession(); app.Run(context => { - int? value = context.Session.GetInt("Key"); + int? value = context.Session.GetInt32("Key"); if (context.Request.Path == new PathString("/first")) { Assert.False(value.HasValue); value = 0; - context.Session.SetInt("Key", 1); + context.Session.SetInt32("Key", 1); } else if (context.Request.Path == new PathString("/second")) { @@ -231,12 +231,12 @@ namespace Microsoft.AspNet.Session }); app.Run(context => { - int? value = context.Session.GetInt("Key"); + int? value = context.Session.GetInt32("Key"); if (context.Request.Path == new PathString("/first")) { Assert.False(value.HasValue); value = 1; - context.Session.SetInt("Key", 1); + context.Session.SetInt32("Key", 1); } else if (context.Request.Path == new PathString("/second")) {