Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved some files around and renamed the project for own personal clar…

…ity.
  • Loading branch information...
commit 8149e7c3329905917e3ebd44496d1d1bff4851f8 1 parent 9494da0
@chadman authored
Showing with 1,322 additions and 42,826 deletions.
  1. +0 −73 Console/Console.csproj
  2. +0 −42 Console/Program.cs
  3. +0 −36 Console/Properties/AssemblyInfo.cs
  4. +0 −3  Console/app.config
  5. +0 −6 Console/packages.config
  6. 0  README
  7. +0 −54 RedisExample.sln
  8. +37 −0 RedisProvider/App_Start/BundleConfig.cs
  9. +10 −0 RedisProvider/App_Start/FilterConfig.cs
  10. +2 −19 Web/Global.asax.cs → RedisProvider/App_Start/RouteConfig.cs
  11. +150 −18 {Web2 → RedisProvider}/Content/Site.css
  12. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png
  13. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png
  14. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png
  15. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png
  16. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png
  17. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png
  18. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png
  19. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  20. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-icons_222222_256x240.png
  21. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-icons_2e83ff_256x240.png
  22. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-icons_454545_256x240.png
  23. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-icons_888888_256x240.png
  24. 0  {Web2 → RedisProvider}/Content/themes/base/images/ui-icons_cd0a0a_256x240.png
  25. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.accordion.css
  26. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.all.css
  27. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.autocomplete.css
  28. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.base.css
  29. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.button.css
  30. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.core.css
  31. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.datepicker.css
  32. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.dialog.css
  33. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.progressbar.css
  34. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.resizable.css
  35. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.selectable.css
  36. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.slider.css
  37. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.tabs.css
  38. 0  {Web2 → RedisProvider}/Content/themes/base/jquery.ui.theme.css
  39. +6 −61 {Web2 → RedisProvider}/Controllers/AccountController.cs
  40. +4 −6 {Web2 → RedisProvider}/Controllers/HomeController.cs
  41. +1 −0  RedisProvider/Global.asax
  42. +23 −0 RedisProvider/Global.asax.cs
  43. 0  {Web2 → RedisProvider}/Images/NuGetGallery.png
  44. 0  {Web2 → RedisProvider}/Images/accent.png
  45. 0  {Web2 → RedisProvider}/Images/aspNetHome.png
  46. 0  {Web2 → RedisProvider}/Images/bullet.png
  47. 0  {Web2 → RedisProvider}/Images/facebook.png
  48. 0  {Web2 → RedisProvider}/Images/findHosting.png
  49. 0  {Web2 → RedisProvider}/Images/heroAccent.png
  50. BIN  RedisProvider/Images/orderedList0.png
  51. 0  Web2/Images/orderedListOne.png → RedisProvider/Images/orderedList1.png
  52. 0  Web2/Images/orderedListTwo.png → RedisProvider/Images/orderedList2.png
  53. 0  Web2/Images/orderedListThree.png → RedisProvider/Images/orderedList3.png
  54. BIN  RedisProvider/Images/orderedList4.png
  55. BIN  RedisProvider/Images/orderedList5.png
  56. BIN  RedisProvider/Images/orderedList6.png
  57. BIN  RedisProvider/Images/orderedList7.png
  58. BIN  RedisProvider/Images/orderedList8.png
  59. BIN  RedisProvider/Images/orderedList9.png
  60. 0  {Web2 → RedisProvider}/Images/twitter.png
  61. 0  {Web2 → RedisProvider}/Images/windowsLive.png
  62. +1 −1  {Web2 → RedisProvider}/Models/AccountModels.cs
  63. +5 −5 {Web2 → RedisProvider}/Properties/AssemblyInfo.cs
  64. +84 −68 Web2/Web2.csproj → RedisProvider/RedisProvider.csproj
  65. +1 −0  {Web → RedisProvider}/Scripts/_references.js
  66. 0  {Web2 → RedisProvider}/Scripts/jquery-1.6.2-vsdoc.js
  67. 0  {Web2 → RedisProvider}/Scripts/jquery-1.6.2.js
  68. 0  {Web2 → RedisProvider}/Scripts/jquery-1.6.2.min.js
  69. 0  {Web2 → RedisProvider}/Scripts/jquery-ui-1.8.11.js
  70. 0  {Web2 → RedisProvider}/Scripts/jquery-ui-1.8.11.min.js
  71. 0  {Web2 → RedisProvider}/Scripts/jquery.unobtrusive-ajax.js
  72. 0  {Web2 → RedisProvider}/Scripts/jquery.unobtrusive-ajax.min.js
  73. 0  {Web2 → RedisProvider}/Scripts/jquery.validate-vsdoc.js
  74. 0  {Web2 → RedisProvider}/Scripts/jquery.validate.js
  75. 0  {Web2 → RedisProvider}/Scripts/jquery.validate.min.js
  76. 0  {Web2 → RedisProvider}/Scripts/jquery.validate.unobtrusive.js
  77. 0  {Web2 → RedisProvider}/Scripts/jquery.validate.unobtrusive.min.js
  78. 0  {Web2 → RedisProvider}/Scripts/knockout-2.0.0.debug.js
  79. 0  {Web2 → RedisProvider}/Scripts/knockout-2.0.0.js
  80. 0  {Web2 → RedisProvider}/Scripts/modernizr-2.0.6-development-only.js
  81. +330 −0 RedisProvider/SessionProvider/RedisSessionProvider.cs
  82. +41 −0 RedisProvider/Views/Account/ChangePassword.cshtml
  83. +1 −1  {Web2 → RedisProvider}/Views/Account/ChangePasswordSuccess.cshtml
  84. +7 −8 {Web2 → RedisProvider}/Views/Account/Login.cshtml
  85. +9 −12 {Web2 → RedisProvider}/Views/Account/Register.cshtml
  86. +34 −0 RedisProvider/Views/Home/About.cshtml
  87. +3 −3 {Web2 → RedisProvider}/Views/Home/Contact.cshtml
  88. +19 −8 {Web2 → RedisProvider}/Views/Home/Index.cshtml
  89. +2 −2 {Web2 → RedisProvider}/Views/Home/_sessionItems.cshtml
  90. 0  {Web2 → RedisProvider}/Views/Shared/Error.cshtml
  91. +8 −5 {Web2 → RedisProvider}/Views/Shared/_Layout.cshtml
  92. +2 −2 {Web2 → RedisProvider}/Views/Shared/_LoginPartial.cshtml
  93. +1 −0  {Web2 → RedisProvider}/Views/Web.config
  94. 0  {Web2 → RedisProvider}/Views/_ViewStart.cshtml
  95. 0  {Web2 → RedisProvider}/Web.Debug.config
  96. 0  {Web2 → RedisProvider}/Web.Release.config
  97. +17 −4 {Web → RedisProvider}/Web.config
  98. 0  {Web2 → RedisProvider}/favicon.ico
  99. +26 −0 RedisProvider/packages.config
  100. +0 −61 Web/Content/Site.css
  101. BIN  Web/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png
  102. BIN  Web/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png
  103. BIN  Web/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png
  104. BIN  Web/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png
  105. BIN  Web/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png
  106. BIN  Web/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png
  107. BIN  Web/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png
  108. BIN  Web/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  109. BIN  Web/Content/themes/base/images/ui-icons_222222_256x240.png
  110. BIN  Web/Content/themes/base/images/ui-icons_2e83ff_256x240.png
  111. BIN  Web/Content/themes/base/images/ui-icons_454545_256x240.png
  112. BIN  Web/Content/themes/base/images/ui-icons_888888_256x240.png
  113. BIN  Web/Content/themes/base/images/ui-icons_cd0a0a_256x240.png
  114. +0 −24 Web/Content/themes/base/jquery.ui.accordion.css
  115. +0 −16 Web/Content/themes/base/jquery.ui.all.css
  116. +0 −62 Web/Content/themes/base/jquery.ui.autocomplete.css
  117. +0 −11 Web/Content/themes/base/jquery.ui.base.css
  118. +0 −43 Web/Content/themes/base/jquery.ui.button.css
  119. +0 −46 Web/Content/themes/base/jquery.ui.core.css
  120. +0 −73 Web/Content/themes/base/jquery.ui.datepicker.css
  121. +0 −26 Web/Content/themes/base/jquery.ui.dialog.css
  122. +0 −16 Web/Content/themes/base/jquery.ui.progressbar.css
  123. +0 −25 Web/Content/themes/base/jquery.ui.resizable.css
  124. +0 −15 Web/Content/themes/base/jquery.ui.selectable.css
  125. +0 −29 Web/Content/themes/base/jquery.ui.slider.css
  126. +0 −23 Web/Content/themes/base/jquery.ui.tabs.css
  127. +0 −257 Web/Content/themes/base/jquery.ui.theme.css
  128. +0 −1  Web/Global.asax
  129. +0 −35 Web/Properties/AssemblyInfo.cs
  130. +0 −9,134 Web/Scripts/jquery-1.6.2-vsdoc.js
  131. +0 −9,007 Web/Scripts/jquery-1.6.2.js
  132. +0 −45 Web/Scripts/jquery-1.6.2.min.js
  133. +0 −12,515 Web/Scripts/jquery-ui-1.8.11.js
  134. +0 −1,682 Web/Scripts/jquery-ui-1.8.11.min.js
  135. +0 −163 Web/Scripts/jquery.unobtrusive-ajax.js
  136. +0 −5 Web/Scripts/jquery.unobtrusive-ajax.min.js
  137. +0 −1,323 Web/Scripts/jquery.validate-vsdoc.js
  138. +0 −1,194 Web/Scripts/jquery.validate.js
  139. +0 −79 Web/Scripts/jquery.validate.min.js
  140. +0 −345 Web/Scripts/jquery.validate.unobtrusive.js
  141. +0 −5 Web/Scripts/jquery.validate.unobtrusive.min.js
  142. +0 −3,255 Web/Scripts/knockout-2.0.0.debug.js
  143. +0 −129 Web/Scripts/knockout-2.0.0.js
  144. +0 −1,160 Web/Scripts/modernizr-2.0.6-development-only.js
  145. +0 −121 Web/SessionProvider/CustomServiceProvider.cs
  146. +0 −16 Web/Views/Shared/Error.cshtml
  147. +0 −14 Web/Views/Shared/_Layout.cshtml
  148. +0 −58 Web/Views/Web.config
  149. +0 −3  Web/Views/_ViewStart.cshtml
  150. +0 −30 Web/Web.Debug.config
  151. +0 −31 Web/Web.Release.config
  152. +0 −226 Web/Web.csproj
  153. +0 −24 Web/packages.config
  154. +0 −14 Web2.Tests/App.config
  155. +0 −49 Web2.Tests/Controllers/HomeControllerTest.cs
  156. +0 −35 Web2.Tests/Properties/AssemblyInfo.cs
  157. +0 −72 Web2.Tests/Web2.Tests.csproj
  158. +0 −1  Web2/Global.asax
  159. +0 −44 Web2/Global.asax.cs
  160. +0 −110 Web2/Scripts/AjaxLogin.js
  161. +0 −5 Web2/Scripts/_references.js
  162. +0 −375 Web2/SessionProvider/CustomServiceProvider.cs
  163. +0 −154 Web2/SessionProvider/CustomSessionManager.cs
  164. +0 −43 Web2/Views/Account/ChangePassword.cshtml
  165. +0 −59 Web2/Views/Home/About.cshtml
  166. +0 −74 Web2/Web.config
  167. +0 −27 Web2/packages.config
  168. BIN  lib/ServiceStack.Common.dll
  169. BIN  lib/ServiceStack.Interfaces.dll
  170. BIN  lib/ServiceStack.Redis.dll
  171. +464 −0 lib/ServiceStack.Text.XML
  172. BIN  lib/ServiceStack.Text.dll
  173. +34 −0 redis-provider.sln
View
73 Console/Console.csproj
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Console</RootNamespace>
- <AssemblyName>Console</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="ServiceStack.Common">
- <HintPath>..\packages\ServiceStack.Common.3.8.3\lib\net35\ServiceStack.Common.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Interfaces">
- <HintPath>..\packages\ServiceStack.Common.3.8.3\lib\net35\ServiceStack.Interfaces.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Redis">
- <HintPath>..\packages\ServiceStack.Redis.3.8.4\lib\net35\ServiceStack.Redis.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Text">
- <HintPath>..\packages\ServiceStack.Text.3.8.3\lib\net35\ServiceStack.Text.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
42 Console/Program.cs
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Console {
- class Program {
- static void Main(string[] args) {
-
- using (var redisClient = new ServiceStack.Redis.RedisClient("127.0.0.1", 6379)) {
- redisClient.Add<string>("session", "chadmeyer", DateTime.Now.AddMinutes(1));
-
- System.Console.WriteLine(string.Format("value of session is {0}", redisClient.Get<string>("session")));
-
- System.Threading.Thread.Sleep(2000);
-
- redisClient.Add("timer", "1", DateTime.Now.AddSeconds(15));
-
- System.Console.WriteLine("added a timer");
-
- bool keyExists = true;
- int count = 1;
-
- while (keyExists) {
- if (redisClient.ContainsKey("timer")) {
- System.Console.WriteLine(string.Format("counting the timer to expired key {0}", count));
- count++;
- System.Threading.Thread.Sleep(1000);
- }
- else {
- keyExists = false;
- System.Console.WriteLine(string.Format("Key was expired after {0} seconds", count));
- }
- }
- }
-
-
- System.Console.ReadLine();
-
- }
- }
-}
View
36 Console/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Console")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Console")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b716f11e-e2e0-41fd-9e59-acb49885b6df")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
3  Console/app.config
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
-<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
View
6 Console/packages.config
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="ServiceStack.Common" version="3.8.3" />
- <package id="ServiceStack.Redis" version="3.8.4" />
- <package id="ServiceStack.Text" version="3.8.3" />
-</packages>
View
0  README
No changes.
View
54 RedisExample.sln
@@ -1,54 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console\Console.csproj", "{D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web2", "Web2\Web2.csproj", "{985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web2.Tests", "Web2.Tests\Web2.Tests.csproj", "{F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Debug|Any CPU.ActiveCfg = Debug|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Debug|x86.ActiveCfg = Debug|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Debug|x86.Build.0 = Debug|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Release|Any CPU.ActiveCfg = Release|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Release|Mixed Platforms.Build.0 = Release|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Release|x86.ActiveCfg = Release|x86
- {D9EDC08D-9EC2-4E8F-AEE4-E75C02C66746}.Release|x86.Build.0 = Release|x86
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Debug|x86.ActiveCfg = Debug|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Release|Any CPU.Build.0 = Release|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}.Release|x86.ActiveCfg = Release|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Release|Any CPU.Build.0 = Release|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {F1B88D1A-7F3C-4CCB-8B34-3E13B7169B93}.Release|x86.ActiveCfg = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
View
37 RedisProvider/App_Start/BundleConfig.cs
@@ -0,0 +1,37 @@
+using System.Web;
+using System.Web.Optimization;
+
+namespace RedisProvider {
+ public class BundleConfig {
+ public static void RegisterBundles(BundleCollection bundles) {
+ bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
+ "~/Scripts/jquery-1.*"));
+
+ bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
+ "~/Scripts/jquery-ui*"));
+
+ bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
+ "~/Scripts/jquery.unobtrusive*",
+ "~/Scripts/jquery.validate*"));
+
+ bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
+ "~/Scripts/modernizr-*"));
+
+ bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
+
+ bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
+ "~/Content/themes/base/jquery.ui.core.css",
+ "~/Content/themes/base/jquery.ui.resizable.css",
+ "~/Content/themes/base/jquery.ui.selectable.css",
+ "~/Content/themes/base/jquery.ui.accordion.css",
+ "~/Content/themes/base/jquery.ui.autocomplete.css",
+ "~/Content/themes/base/jquery.ui.button.css",
+ "~/Content/themes/base/jquery.ui.dialog.css",
+ "~/Content/themes/base/jquery.ui.slider.css",
+ "~/Content/themes/base/jquery.ui.tabs.css",
+ "~/Content/themes/base/jquery.ui.datepicker.css",
+ "~/Content/themes/base/jquery.ui.progressbar.css",
+ "~/Content/themes/base/jquery.ui.theme.css"));
+ }
+ }
+}
View
10 RedisProvider/App_Start/FilterConfig.cs
@@ -0,0 +1,10 @@
+using System.Web;
+using System.Web.Mvc;
+
+namespace RedisProvider {
+ public class FilterConfig {
+ public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
+ filters.Add(new HandleErrorAttribute());
+ }
+ }
+}
View
21 Web/Global.asax.cs → RedisProvider/App_Start/RouteConfig.cs
@@ -4,18 +4,10 @@
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
-using System.Web.Optimization;
using System.Web.Routing;
-namespace Web {
- // Note: For instructions on enabling IIS6 or IIS7 classic mode,
- // visit http://go.microsoft.com/?LinkId=9394801
-
- public class MvcApplication : System.Web.HttpApplication {
- public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
- filters.Add(new HandleErrorAttribute());
- }
-
+namespace RedisProvider {
+ public class RouteConfig {
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
@@ -31,14 +23,5 @@ public class MvcApplication : System.Web.HttpApplication {
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
-
- protected void Application_Start() {
- AreaRegistration.RegisterAllAreas();
-
- RegisterGlobalFilters(GlobalFilters.Filters);
- RegisterRoutes(RouteTable.Routes);
-
- BundleTable.Bundles.RegisterTemplateBundles();
- }
}
}
View
168 Web2/Content/Site.css → RedisProvider/Content/Site.css
@@ -14,8 +14,7 @@ body {
padding: 0;
}
-a:link, a:visited,
-a:active, a:hover {
+a {
color: #333;
outline: none;
padding-left: 3px;
@@ -23,15 +22,26 @@ a:active, a:hover {
text-decoration: underline;
}
-a:hover {
- background-color: #c7d1d6;
-}
+ a:link, a:visited,
+ a:active, a:hover {
+ color: #333;
+ }
+
+ a:hover {
+ background-color: #c7d1d6;
+ }
header, footer, hgroup,
nav, section {
display: block;
}
+mark {
+ background-color: #a6dbed;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
.float-left {
float: left;
}
@@ -40,12 +50,6 @@ nav, section {
float: right;
}
-.highlight {
- background-color: #a6dbed;
- padding-left: 5px;
- padding-right: 5px;
-}
-
.clear-fix:after {
content: ".";
clear: both;
@@ -248,16 +252,44 @@ ol.round {
padding-left: 45px;
}
+ ol.round li.zero {
+ background: url("../Images/orderedList0.png") no-repeat;
+ }
+
ol.round li.one {
- background: url("../Images/orderedListOne.png") no-repeat;
+ background: url("../Images/orderedList1.png") no-repeat;
}
ol.round li.two {
- background: url("../Images/orderedListTwo.png") no-repeat;
+ background: url("../Images/orderedList2.png") no-repeat;
}
ol.round li.three {
- background: url("../Images/orderedListThree.png") no-repeat;
+ background: url("../Images/orderedList3.png") no-repeat;
+ }
+
+ ol.round li.four {
+ background: url("../Images/orderedList4.png") no-repeat;
+ }
+
+ ol.round li.five {
+ background: url("../Images/orderedList5.png") no-repeat;
+ }
+
+ ol.round li.six {
+ background: url("../Images/orderedList6.png") no-repeat;
+ }
+
+ ol.round li.seven {
+ background: url("../Images/orderedList7.png") no-repeat;
+ }
+
+ ol.round li.eight {
+ background: url("../Images/orderedList8.png") no-repeat;
+ }
+
+ ol.round li.nine {
+ background: url("../Images/orderedList9.png") no-repeat;
}
/* content */
@@ -372,8 +404,41 @@ fieldset {
}
/* ajax login/registration dialog */
+.ui-dialog {
+ font-family: inherit;
+ font-size: 1.0em;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+ border: 0 none;
+}
+
+ .ui-dialog input {
+ font-family: inherit;
+ font-size: 1.25em;
+ }
+
+.ui-dialog-titlebar {
+ color: inherit;
+ font-weight: inherit;
+ border: 0 none;
+ background: none;
+ float: right;
+}
+
+.ui-dialog-titlebar-close {
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+}
+
+.ui-widget-header {
+ border: 0 none;
+ background: none;
+}
+
.modal-popup {
- font-size: 0.7em;
+
}
.modal-popup input[type="text"],
@@ -459,6 +524,68 @@ ul#social li {
background: url("../Images/twitter.png") no-repeat;
}
+/* tables
+----------------------------------------------------------*/
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+ margin-top: 0.75em;
+ border: 0 none;
+}
+
+th {
+ font-size: 1.2em;
+ text-align: left;
+ border: none 0px;
+ padding-left: 0;
+}
+
+ th a {
+ display: block;
+ position: relative;
+
+ }
+
+ th a:link, th a:visited, th a:active, th a:hover {
+ color: #333;
+ font-weight: 600;
+ text-decoration: none;
+ padding: 0;
+ }
+
+ th a:hover {
+ color: #000;
+ }
+
+ th.asc a, th.desc a {
+ margin-right: .75em;
+ }
+
+ th.asc a:after, th.desc a:after {
+ display: block;
+ position: absolute;
+ right: 0em;
+ top: 0;
+ font-size: 0.75em;
+ }
+
+ th.asc a:after {
+ content: '';
+ }
+
+ th.desc a:after {
+ content: '';
+ }
+
+td {
+ padding: 0.25em 2em 0.25em 0em;
+ border: 0 none;
+}
+
+tr.pager td {
+ padding: 0 0.25em 0 0;
+}
+
/********************
* Mobile Styles *
@@ -559,9 +686,16 @@ ul#social li {
margin: 25px 0;
}
+ ol.round li.zero,
ol.round li.one,
ol.round li.two,
- ol.round li.three {
+ ol.round li.three,
+ ol.round li.four,
+ ol.round li.five,
+ ol.round li.six,
+ ol.round li.seven,
+ ol.round li.eight,
+ ol.round li.nine {
background: none;
}
@@ -629,9 +763,7 @@ ul#social li {
background: none;
display: inline;
float: none;
- height: auto;
padding-left: 0;
text-indent: 0;
- width: auto;
}
}
View
0  ...themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png → ...themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png
File renamed without changes
View
0  ...hemes/base/images/ui-bg_flat_75_ffffff_40x100.png → ...hemes/base/images/ui-bg_flat_75_ffffff_40x100.png
File renamed without changes
View
0  ...hemes/base/images/ui-bg_glass_55_fbf9ee_1x400.png → ...hemes/base/images/ui-bg_glass_55_fbf9ee_1x400.png
File renamed without changes
View
0  ...hemes/base/images/ui-bg_glass_65_ffffff_1x400.png → ...hemes/base/images/ui-bg_glass_65_ffffff_1x400.png
File renamed without changes
View
0  ...hemes/base/images/ui-bg_glass_75_dadada_1x400.png → ...hemes/base/images/ui-bg_glass_75_dadada_1x400.png
File renamed without changes
View
0  ...hemes/base/images/ui-bg_glass_75_e6e6e6_1x400.png → ...hemes/base/images/ui-bg_glass_75_e6e6e6_1x400.png
File renamed without changes
View
0  ...hemes/base/images/ui-bg_glass_95_fef1ec_1x400.png → ...hemes/base/images/ui-bg_glass_95_fef1ec_1x400.png
File renamed without changes
View
0  ...e/images/ui-bg_highlight-soft_75_cccccc_1x100.png → ...e/images/ui-bg_highlight-soft_75_cccccc_1x100.png
File renamed without changes
View
0  ...nt/themes/base/images/ui-icons_222222_256x240.png → ...nt/themes/base/images/ui-icons_222222_256x240.png
File renamed without changes
View
0  ...nt/themes/base/images/ui-icons_2e83ff_256x240.png → ...nt/themes/base/images/ui-icons_2e83ff_256x240.png
File renamed without changes
View
0  ...nt/themes/base/images/ui-icons_454545_256x240.png → ...nt/themes/base/images/ui-icons_454545_256x240.png
File renamed without changes
View
0  ...nt/themes/base/images/ui-icons_888888_256x240.png → ...nt/themes/base/images/ui-icons_888888_256x240.png
File renamed without changes
View
0  ...nt/themes/base/images/ui-icons_cd0a0a_256x240.png → ...nt/themes/base/images/ui-icons_cd0a0a_256x240.png
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.accordion.css → ...vider/Content/themes/base/jquery.ui.accordion.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.all.css → RedisProvider/Content/themes/base/jquery.ui.all.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.autocomplete.css → ...er/Content/themes/base/jquery.ui.autocomplete.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.base.css → RedisProvider/Content/themes/base/jquery.ui.base.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.button.css → ...Provider/Content/themes/base/jquery.ui.button.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.core.css → RedisProvider/Content/themes/base/jquery.ui.core.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.datepicker.css → ...ider/Content/themes/base/jquery.ui.datepicker.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.dialog.css → ...Provider/Content/themes/base/jquery.ui.dialog.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.progressbar.css → ...der/Content/themes/base/jquery.ui.progressbar.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.resizable.css → ...vider/Content/themes/base/jquery.ui.resizable.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.selectable.css → ...ider/Content/themes/base/jquery.ui.selectable.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.slider.css → ...Provider/Content/themes/base/jquery.ui.slider.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.tabs.css → RedisProvider/Content/themes/base/jquery.ui.tabs.css
File renamed without changes
View
0  Web2/Content/themes/base/jquery.ui.theme.css → ...sProvider/Content/themes/base/jquery.ui.theme.css
File renamed without changes
View
67 Web2/Controllers/AccountController.cs → RedisProvider/Controllers/AccountController.cs
@@ -4,9 +4,9 @@
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
-using Web2.Models;
+using RedisProvider.Models;
-namespace Web2.Controllers {
+namespace RedisProvider.Controllers {
[Authorize]
public class AccountController : Controller {
@@ -15,28 +15,9 @@ public class AccountController : Controller {
// GET: /Account/Login
[AllowAnonymous]
- public ActionResult Login() {
- return ContextDependentView();
- }
-
- //
- // POST: /Account/JsonLogin
-
- [AllowAnonymous]
- [HttpPost]
- public JsonResult JsonLogin(LoginModel model, string returnUrl) {
- if (ModelState.IsValid) {
- if (Membership.ValidateUser(model.UserName, model.Password)) {
- FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
- return Json(new { success = true, redirect = returnUrl });
- }
- else {
- ModelState.AddModelError("", "The user name or password provided is incorrect.");
- }
- }
-
- // If we got this far, something failed
- return Json(new { errors = GetErrorsFromModelState() });
+ public ActionResult Login(string returnUrl) {
+ ViewBag.ReturnUrl = returnUrl;
+ return View();
}
//
@@ -78,31 +59,7 @@ public class AccountController : Controller {
[AllowAnonymous]
public ActionResult Register() {
- return ContextDependentView();
- }
-
- //
- // POST: /Account/JsonRegister
-
- [AllowAnonymous]
- [HttpPost]
- public ActionResult JsonRegister(RegisterModel model) {
- if (ModelState.IsValid) {
- // Attempt to register the user
- MembershipCreateStatus createStatus;
- Membership.CreateUser(model.UserName, model.Password, model.Email, passwordQuestion: null, passwordAnswer: null, isApproved: true, providerUserKey: null, status: out createStatus);
-
- if (createStatus == MembershipCreateStatus.Success) {
- FormsAuthentication.SetAuthCookie(model.UserName, createPersistentCookie: false);
- return Json(new { success = true });
- }
- else {
- ModelState.AddModelError("", ErrorCodeToString(createStatus));
- }
- }
-
- // If we got this far, something failed
- return Json(new { errors = GetErrorsFromModelState() });
+ return View();
}
//
@@ -173,18 +130,6 @@ public class AccountController : Controller {
return View();
}
- private ActionResult ContextDependentView() {
- string actionName = ControllerContext.RouteData.GetRequiredString("action");
- if (Request.QueryString["content"] != null) {
- ViewBag.FormAction = "Json" + actionName;
- return PartialView();
- }
- else {
- ViewBag.FormAction = actionName;
- return View();
- }
- }
-
private IEnumerable<string> GetErrorsFromModelState() {
return ModelState.SelectMany(x => x.Value.Errors.Select(error => error.ErrorMessage));
}
View
10 Web2/Controllers/HomeController.cs → RedisProvider/Controllers/HomeController.cs
@@ -4,17 +4,15 @@
using System.Web;
using System.Web.Mvc;
-namespace Web2.Controllers {
+namespace RedisProvider.Controllers {
public class HomeController : Controller {
public ActionResult Index() {
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
- Session["key"] = "thekey";
-
List<KeyValuePair<string, string>> sessionObjects = new List<KeyValuePair<string, string>>();
for (int i = 0; i < Session.Keys.Count; i++) {
- KeyValuePair<string, string> keyValue = new KeyValuePair<string,string>(Session.Keys.Get(i), Session[i].ToString());
+ KeyValuePair<string, string> keyValue = new KeyValuePair<string, string>(Session.Keys.Get(i), Session[i].ToString());
sessionObjects.Add(keyValue);
}
@@ -38,13 +36,13 @@ public class HomeController : Controller {
}
public ActionResult About() {
- ViewBag.Message = "Your quintessential app description page.";
+ ViewBag.Message = "Your app description page.";
return View();
}
public ActionResult Contact() {
- ViewBag.Message = "Your quintessential contact page.";
+ ViewBag.Message = "Your contact page.";
return View();
}
View
1  RedisProvider/Global.asax
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="RedisProvider.MvcApplication" Language="C#" %>
View
23 RedisProvider/Global.asax.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Http;
+using System.Web.Mvc;
+using System.Web.Optimization;
+using System.Web.Routing;
+
+namespace RedisProvider {
+ // Note: For instructions on enabling IIS6 or IIS7 classic mode,
+ // visit http://go.microsoft.com/?LinkId=9394801
+
+ public class MvcApplication : System.Web.HttpApplication {
+ protected void Application_Start() {
+ AreaRegistration.RegisterAllAreas();
+
+ FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
+ RouteConfig.RegisterRoutes(RouteTable.Routes);
+ BundleConfig.RegisterBundles(BundleTable.Bundles);
+ }
+ }
+}
View
0  Web2/Images/NuGetGallery.png → RedisProvider/Images/NuGetGallery.png
File renamed without changes
View
0  Web2/Images/accent.png → RedisProvider/Images/accent.png
File renamed without changes
View
0  Web2/Images/aspNetHome.png → RedisProvider/Images/aspNetHome.png
File renamed without changes
View
0  Web2/Images/bullet.png → RedisProvider/Images/bullet.png
File renamed without changes
View
0  Web2/Images/facebook.png → RedisProvider/Images/facebook.png
File renamed without changes
View
0  Web2/Images/findHosting.png → RedisProvider/Images/findHosting.png
File renamed without changes
View
0  Web2/Images/heroAccent.png → RedisProvider/Images/heroAccent.png
File renamed without changes
View
BIN  RedisProvider/Images/orderedList0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  Web2/Images/orderedListOne.png → RedisProvider/Images/orderedList1.png
File renamed without changes
View
0  Web2/Images/orderedListTwo.png → RedisProvider/Images/orderedList2.png
File renamed without changes
View
0  Web2/Images/orderedListThree.png → RedisProvider/Images/orderedList3.png
File renamed without changes
View
BIN  RedisProvider/Images/orderedList4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  RedisProvider/Images/orderedList5.png
Diff not rendered
View
BIN  RedisProvider/Images/orderedList6.png
Diff not rendered
View
BIN  RedisProvider/Images/orderedList7.png
Diff not rendered
View
BIN  RedisProvider/Images/orderedList8.png
Diff not rendered
View
BIN  RedisProvider/Images/orderedList9.png
Diff not rendered
View
0  Web2/Images/twitter.png → RedisProvider/Images/twitter.png
Diff not rendered
View
0  Web2/Images/windowsLive.png → RedisProvider/Images/windowsLive.png
Diff not rendered
View
2  Web2/Models/AccountModels.cs → RedisProvider/Models/AccountModels.cs
@@ -5,7 +5,7 @@
using System.Web.Mvc;
using System.Web.Security;
-namespace Web2.Models {
+namespace RedisProvider.Models {
public class ChangePasswordModel {
[Required]
View
10 Web2/Properties/AssemblyInfo.cs → RedisProvider/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("Web2")]
+[assembly: AssemblyTitle("RedisProvider")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Web2")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("RedisProvider")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("bebbd8fd-d64c-44d3-944d-2f0091fccce6")]
+[assembly: Guid("6f7e5d97-102b-4eea-971a-821ae7fde4b8")]
// Version information for an assembly consists of the following four values:
//
View
152 Web2/Web2.csproj → RedisProvider/RedisProvider.csproj
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{985790EF-4E0E-4ABB-8BAD-0E4B894E7D97}</ProjectGuid>
+ <ProjectGuid>{BFE6562E-68BE-420A-AA4B-613FF93B5578}</ProjectGuid>
<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Web2</RootNamespace>
- <AssemblyName>Web2</AssemblyName>
+ <RootNamespace>RedisProvider</RootNamespace>
+ <AssemblyName>RedisProvider</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>false</UseIISExpress>
@@ -34,105 +35,108 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="EntityFramework">
- <HintPath>..\packages\EntityFramework.4.1.10331.0\lib\net40\EntityFramework.dll</HintPath>
- </Reference>
<Reference Include="Microsoft.CSharp" />
- <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
- </Reference>
<Reference Include="ServiceStack.Common">
- <HintPath>..\packages\ServiceStack.Common.3.8.3\lib\net35\ServiceStack.Common.dll</HintPath>
+ <HintPath>..\lib\ServiceStack.Common.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Interfaces">
- <HintPath>..\packages\ServiceStack.Common.3.8.3\lib\net35\ServiceStack.Interfaces.dll</HintPath>
+ <HintPath>..\lib\ServiceStack.Interfaces.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Redis">
- <HintPath>..\packages\ServiceStack.Redis.3.8.4\lib\net35\ServiceStack.Redis.dll</HintPath>
+ <HintPath>..\lib\ServiceStack.Redis.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text">
- <HintPath>..\packages\ServiceStack.Text.3.8.3\lib\net35\ServiceStack.Text.dll</HintPath>
+ <HintPath>..\lib\ServiceStack.Text.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Drawing" />
- <Reference Include="System.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <Reference Include="System.Web.DynamicData" />
+ <Reference Include="System.Web.Entity" />
+ <Reference Include="System.Web.ApplicationServices" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Extensions" />
+ <Reference Include="System.Web.Abstractions" />
+ <Reference Include="System.Web.Routing" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Web.Services" />
+ <Reference Include="System.EnterpriseServices" />
+ <Reference Include="EntityFramework">
+ <HintPath>..\packages\EntityFramework.5.0.0-rc\lib\net40\EntityFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\System.Json.4.0.20126.16343\lib\net40\System.Json.dll</HintPath>
+ <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
- <Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.1\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http">
<Private>True</Private>
- <HintPath>..\packages\System.Net.Http.2.0.20126.16343\lib\net40\System.Net.Http.dll</HintPath>
+ <HintPath>..\packages\Microsoft.Net.Http.2.0.20505.0\lib\net40\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\System.Net.Http.Formatting.4.0.20126.16343\lib\net40\System.Net.Http.Formatting.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.20505.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
</Reference>
- <Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <Reference Include="System.Net.Http.WebRequest">
<Private>True</Private>
- <HintPath>..\packages\System.Net.Http.2.0.20126.16343\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
+ <HintPath>..\packages\Microsoft.Net.Http.2.0.20505.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
</Reference>
- <Reference Include="System.Web.DynamicData" />
- <Reference Include="System.Web.Entity" />
- <Reference Include="System.Web.ApplicationServices" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.Helpers.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20505.0\lib\net40\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\AspNetWebApi.Core.4.0.20126.16343\lib\net40\System.Web.Http.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Http.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\System.Web.Http.Common.4.0.20126.16343\lib\net40\System.Web.Http.Common.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20505.0\lib\net40\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <Private>True</Private>
- <HintPath>..\packages\AspNetWebApi.4.0.20126.16343\lib\net40\System.Web.Http.WebHost.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20505.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\AspNetMvc.4.0.20126.16343\lib\net40\System.Web.Mvc.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20505.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
- <HintPath>..\packages\Microsoft.Web.Optimization.1.0.0-beta\lib\net40\System.Web.Optimization.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.0.0-beta2\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Providers">
- <HintPath>..\packages\System.Web.Providers.Core.1.0\lib\net40\System.Web.Providers.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.Providers.Core.1.0\lib\net40\System.Web.Providers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\AspNetRazor.Core.2.0.20126.16343\lib\net40\System.Web.Razor.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20505.0\lib\net40\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.WebPages.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20505.0\lib\net40\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20505.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
- <HintPath>..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
+ <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20505.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
+ </Reference>
+ <Reference Include="WebGrease">
+ <Private>True</Private>
+ <HintPath>..\packages\WebGrease.1.0.0\lib\WebGrease.dll</HintPath>
+ </Reference>
+ <Reference Include="Antlr3.Runtime">
+ <Private>True</Private>
+ <HintPath>..\packages\WebGrease.1.0.0\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Web.Abstractions" />
- <Reference Include="System.Web.Routing" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Web.Services" />
- <Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="App_Start\BundleConfig.cs" />
+ <Compile Include="App_Start\FilterConfig.cs" />
+ <Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Global.asax.cs">
@@ -140,8 +144,7 @@
</Compile>
<Compile Include="Models\AccountModels.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="SessionProvider\CustomServiceProvider.cs" />
- <Compile Include="SessionProvider\CustomSessionManager.cs" />
+ <Compile Include="SessionProvider\RedisSessionProvider.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
@@ -188,7 +191,9 @@
<Content Include="Scripts\knockout-2.0.0.debug.js" />
<Content Include="Scripts\knockout-2.0.0.js" />
<Content Include="Scripts\modernizr-2.0.6-development-only.js" />
- <Content Include="Web.config" />
+ <Content Include="Web.config">
+ <SubType>Designer</SubType>
+ </Content>
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
@@ -197,7 +202,6 @@
</Content>
<Content Include="Content\Site.css" />
<Content Include="Scripts\_references.js" />
- <Content Include="Scripts\AjaxLogin.js" />
<Content Include="Images\accent.png" />
<Content Include="Images\aspNetHome.png" />
<Content Include="Images\bullet.png" />
@@ -205,9 +209,16 @@
<Content Include="Images\findHosting.png" />
<Content Include="Images\heroAccent.png" />
<Content Include="Images\NuGetGallery.png" />
- <Content Include="Images\orderedListOne.png" />
- <Content Include="Images\orderedListTwo.png" />
- <Content Include="Images\orderedListThree.png" />
+ <Content Include="Images\orderedList0.png" />
+ <Content Include="Images\orderedList1.png" />
+ <Content Include="Images\orderedList2.png" />
+ <Content Include="Images\orderedList3.png" />
+ <Content Include="Images\orderedList4.png" />
+ <Content Include="Images\orderedList5.png" />
+ <Content Include="Images\orderedList6.png" />
+ <Content Include="Images\orderedList7.png" />
+ <Content Include="Images\orderedList8.png" />
+ <Content Include="Images\orderedList9.png" />
<Content Include="Images\twitter.png" />
<Content Include="Images\windowsLive.png" />
<Content Include="Views\_ViewStart.cshtml" />
@@ -232,14 +243,13 @@
<ItemGroup>
<Content Include="Views\Home\_sessionItems.cshtml" />
</ItemGroup>
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target> -->
+ <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
@@ -249,7 +259,7 @@
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
- <DevelopmentServerPort>51052</DevelopmentServerPort>
+ <DevelopmentServerPort>50201</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
@@ -262,4 +272,10 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target> -->
</Project>
View
1  Web/Scripts/_references.js → RedisProvider/Scripts/_references.js
@@ -1,5 +1,6 @@
/// <reference path="jquery-1.6.2.js" />
/// <reference path="jquery-ui-1.8.11.js" />
/// <reference path="jquery.validate.js" />
+/// <reference path="jquery.validate.unobtrusive.js" />
/// <reference path="knockout-2.0.0.debug.js" />
/// <reference path="modernizr-2.0.6-development-only.js" />
View
0  Web2/Scripts/jquery-1.6.2-vsdoc.js → RedisProvider/Scripts/jquery-1.6.2-vsdoc.js
File renamed without changes
View
0  Web2/Scripts/jquery-1.6.2.js → RedisProvider/Scripts/jquery-1.6.2.js
File renamed without changes
View
0  Web2/Scripts/jquery-1.6.2.min.js → RedisProvider/Scripts/jquery-1.6.2.min.js
File renamed without changes
View
0  Web2/Scripts/jquery-ui-1.8.11.js → RedisProvider/Scripts/jquery-ui-1.8.11.js
File renamed without changes
View
0  Web2/Scripts/jquery-ui-1.8.11.min.js → RedisProvider/Scripts/jquery-ui-1.8.11.min.js
File renamed without changes
View
0  Web2/Scripts/jquery.unobtrusive-ajax.js → RedisProvider/Scripts/jquery.unobtrusive-ajax.js
File renamed without changes
View
0  Web2/Scripts/jquery.unobtrusive-ajax.min.js → RedisProvider/Scripts/jquery.unobtrusive-ajax.min.js
File renamed without changes
View
0  Web2/Scripts/jquery.validate-vsdoc.js → RedisProvider/Scripts/jquery.validate-vsdoc.js
File renamed without changes
View
0  Web2/Scripts/jquery.validate.js → RedisProvider/Scripts/jquery.validate.js
File renamed without changes
View
0  Web2/Scripts/jquery.validate.min.js → RedisProvider/Scripts/jquery.validate.min.js
File renamed without changes
View
0  Web2/Scripts/jquery.validate.unobtrusive.js → RedisProvider/Scripts/jquery.validate.unobtrusive.js
File renamed without changes
View
0  Web2/Scripts/jquery.validate.unobtrusive.min.js → ...ovider/Scripts/jquery.validate.unobtrusive.min.js
File renamed without changes
View
0  Web2/Scripts/knockout-2.0.0.debug.js → RedisProvider/Scripts/knockout-2.0.0.debug.js
File renamed without changes
View
0  Web2/Scripts/knockout-2.0.0.js → RedisProvider/Scripts/knockout-2.0.0.js
File renamed without changes
View
0  Web2/Scripts/modernizr-2.0.6-development-only.js → ...vider/Scripts/modernizr-2.0.6-development-only.js
File renamed without changes
View
330 RedisProvider/SessionProvider/RedisSessionProvider.cs
@@ -0,0 +1,330 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using System.Collections.Specialized;
+using System.Web.SessionState;
+using ServiceStack.Redis;
+using System.Configuration;
+using System.Configuration.Provider;
+using System.Web.Configuration;
+using System.IO;
+
+namespace RedisProvider.SessionProvider {
+
+ #region Repository
+ public interface IRedisServiceProviderRepository {
+ RedisClient OpenRedisClient();
+ }
+
+ public class RedisServiceProviderRepository : IRedisServiceProviderRepository {
+
+ /// <summary>
+ /// This will be used to open a redis connection with specific connection string information
+ /// </summary>
+ /// <returns></returns>
+ public RedisClient OpenRedisClient() {
+ return new RedisClient();
+ }
+ }
+ #endregion Repository
+
+ #region Session Item Model
+ public class SessionItem {
+
+ #region Properties
+ public DateTime CreatedAt { get; set; }
+ public DateTime LockDate { get; set; }
+ public int LockID { get; set; }
+ public int Timeout { get; set; }
+ public bool Locked { get; set; }
+ public string SessionItems { get; set; }
+ public int Flags { get; set; }
+ #endregion Properties
+
+ }
+ #endregion Session Item Model
+
+ public class CustomServiceProvider : System.Web.SessionState.SessionStateStoreProviderBase, IDisposable {
+
+ #region Properties
+ public IRedisServiceProviderRepository Repository { get; set; }
+
+ private string ApplicationName {
+ get {
+ if (ConfigurationManager.AppSettings.AllKeys.Contains("Application.Name")) {
+ return ConfigurationManager.AppSettings["Application.Name"];
+ }
+
+ return string.Empty;
+ }
+ }
+ private SessionStateSection sessionStateConfig = null;
+ #endregion Properties
+
+ #region Private Methods
+ private string RedisKey(string id) {
+ return string.Format("{0}{1}", !string.IsNullOrEmpty(this.ApplicationName) ? this.ApplicationName + ":" : "", id);
+ }
+ #endregion Private Methods
+
+
+ #region Constructor
+ public CustomServiceProvider() {
+ this.Repository = new RedisServiceProviderRepository();
+ }
+ #endregion Constructor
+
+ public override void Dispose() {
+
+ }
+
+ public override void Initialize(string name, NameValueCollection config) {
+
+
+ // Initialize values from web.config.
+ if (config == null) {
+ throw new ArgumentNullException("config");
+ }
+
+ if (name == null || name.Length == 0) {
+ name = "RedisSessionStateStore";
+ }
+
+ if (String.IsNullOrEmpty(config["description"])) {
+ config.Remove("description");
+ config.Add("description", "Redis Session State Provider");
+ }
+
+ // Initialize the abstract base class.
+ base.Initialize(name, config);
+
+ // Get <sessionState> configuration element.
+ Configuration cfg = WebConfigurationManager.OpenWebConfiguration(ApplicationName);
+ sessionStateConfig = (SessionStateSection)cfg.GetSection("system.web/sessionState");
+ }
+
+ public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback) {
+ return true;
+ }
+
+ /// <summary>
+ /// Serialize is called by the SetAndReleaseItemExclusive method to
+ /// convert the SessionStateItemCollection into a Base64 string to
+ /// be stored in MongoDB.
+ /// </summary>
+ private string Serialize(SessionStateItemCollection items) {
+ using (MemoryStream ms = new MemoryStream())
+ using (BinaryWriter writer = new BinaryWriter(ms)) {
+ if (items != null)
+ items.Serialize(writer);
+
+ writer.Close();
+
+ return Convert.ToBase64String(ms.ToArray());
+ }
+ }
+
+ public override void SetAndReleaseItemExclusive(HttpContext context, string id, SessionStateStoreData item, object lockId, bool newItem) {
+ using (RedisClient client = this.Repository.OpenRedisClient()) {
+ // Serialize the SessionStateItemCollection as a string.
+ string sessionItems = Serialize((SessionStateItemCollection)item.Items);
+
+ try {
+ if (newItem) {
+ SessionItem sessionItem = new SessionItem();
+ sessionItem.CreatedAt = DateTime.UtcNow;
+ sessionItem.LockDate = DateTime.UtcNow;
+ sessionItem.LockID = 0;
+ sessionItem.Timeout = item.Timeout;
+ sessionItem.Locked = false;
+ sessionItem.SessionItems = sessionItems;
+ sessionItem.Flags = 0;
+
+ client.Set<SessionItem>(this.RedisKey(id), sessionItem, DateTime.UtcNow.AddMinutes(item.Timeout));
+ }
+ else {
+ SessionItem currentSessionItem = client.Get<SessionItem>(this.RedisKey(id));
+ if (currentSessionItem != null && currentSessionItem.LockID == (int?)lockId) {
+ currentSessionItem.Locked = false;
+ currentSessionItem.SessionItems = sessionItems;
+ client.Set<SessionItem>(this.RedisKey(id), currentSessionItem, DateTime.UtcNow.AddMinutes(item.Timeout));
+ }
+ }
+ }
+ catch (Exception e) {
+ throw e;
+ }
+ }
+ }
+
+ public override SessionStateStoreData GetItemExclusive(HttpContext context, string id, out bool locked, out TimeSpan lockAge, out object lockId, out SessionStateActions actions) {
+ return GetSessionStoreItem(true, context, id, out locked, out lockAge, out lockId, out actions);
+ }
+
+ public override SessionStateStoreData GetItem(HttpContext context, string id, out bool locked, out TimeSpan lockAge, out object lockId, out SessionStateActions actionFlags) {
+ return GetSessionStoreItem(false, context, id, out locked, out lockAge, out lockId, out actionFlags);
+ }
+
+ private SessionStateStoreData GetSessionStoreItem(bool lockRecord,
+ HttpContext context,
+ string id,
+ out bool locked,
+ out TimeSpan lockAge,
+ out object lockId,
+ out SessionStateActions actionFlags) {
+
+ // Initial values for return value and out parameters.
+ SessionStateStoreData item = null;
+ lockAge = TimeSpan.Zero;
+ lockId = null;
+ locked = false;
+ actionFlags = 0;
+
+ // String to hold serialized SessionStateItemCollection.
+ string serializedItems = "";
+
+ // Timeout value from the data store.
+ int timeout = 0;
+
+ using (RedisClient client = this.Repository.OpenRedisClient()) {
+ try {
+ if (lockRecord) {
+ locked = false;
+ SessionItem currentItem = client.Get<SessionItem>(this.RedisKey(id));
+
+ if (currentItem != null) {
+ // If the item is locked then do not attempt to update it
+ if (!currentItem.Locked) {
+ currentItem.Locked = true;
+ currentItem.LockDate = DateTime.UtcNow;
+ client.Set<SessionItem>(this.RedisKey(id), currentItem, DateTime.UtcNow.AddMinutes(sessionStateConfig.Timeout.TotalMinutes));
+ }
+ else {
+ locked = true;
+ }
+ }
+ }
+
+ SessionItem currentSessionItem = client.Get<SessionItem>(this.RedisKey(id));
+
+ if (currentSessionItem != null) {
+ serializedItems = currentSessionItem.SessionItems;
+ lockId = currentSessionItem.LockID;
+ lockAge = DateTime.UtcNow.Subtract(currentSessionItem.LockDate);
+ actionFlags = (SessionStateActions)currentSessionItem.Flags;
+ timeout = currentSessionItem.Timeout;
+ }
+ else {
+ locked = false;
+ }
+
+ if (currentSessionItem != null && !locked) {
+ // Delete the old item before inserting the new one
+ client.Remove(this.RedisKey(id));
+
+ lockId = (int?)lockId + 1;
+ currentSessionItem.LockID = lockId != null ? (int)lockId : 0;
+ currentSessionItem.Flags = 0;
+
+ client.Set<SessionItem>(this.RedisKey(id), currentSessionItem, DateTime.UtcNow.AddMinutes(sessionStateConfig.Timeout.TotalMinutes));
+
+ // If the actionFlags parameter is not InitializeItem,
+ // deserialize the stored SessionStateItemCollection.
+ if (actionFlags == SessionStateActions.InitializeItem) {
+ item = CreateNewStoreData(context, 30);
+ }
+ else {
+ item = Deserialize(context, serializedItems, timeout);
+ }
+ }
+ }
+
+ catch (Exception e) {
+ throw e;
+ }
+ }
+
+ return item;
+ }
+
+
+ private SessionStateStoreData Deserialize(HttpContext context, string serializedItems, int timeout) {
+ using (MemoryStream ms = new MemoryStream(Convert.FromBase64String(serializedItems))) {
+ SessionStateItemCollection sessionItems = new SessionStateItemCollection();
+
+ if (ms.Length > 0) {
+ using (BinaryReader reader = new BinaryReader(ms)) {
+ sessionItems = SessionStateItemCollection.Deserialize(reader);
+ }
+ }
+
+ return new SessionStateStoreData(sessionItems,
+ SessionStateUtility.GetSessionStaticObjects(context),
+ timeout);
+ }
+ }
+
+ public override void ReleaseItemExclusive(HttpContext context, string id, object lockId) {
+
+ using (RedisClient client = this.Repository.OpenRedisClient()) {
+ SessionItem currentSessionItem = client.Get<SessionItem>(this.RedisKey(id));
+
+ if (currentSessionItem != null && (int?)lockId == currentSessionItem.LockID) {
+ currentSessionItem.Locked = false;
+ client.Set<SessionItem>(this.RedisKey(id), currentSessionItem, DateTime.UtcNow.AddMinutes(sessionStateConfig.Timeout.TotalMinutes));
+ }
+ }
+ }
+
+ public override void RemoveItem(HttpContext context, string id, object lockId, SessionStateStoreData item) {
+ using (RedisClient client = this.Repository.OpenRedisClient()) {
+ // Delete the old item before inserting the new one
+ client.Remove(this.RedisKey(id));
+ }
+ }
+
+ public override void CreateUninitializedItem(HttpContext context, string id, int timeout) {
+ using (RedisClient client = this.Repository.OpenRedisClient()) {
+ SessionItem sessionItem = new SessionItem();
+ sessionItem.CreatedAt = DateTime.Now.ToUniversalTime();
+ sessionItem.LockDate = DateTime.Now.ToUniversalTime();
+ sessionItem.LockID = 0;
+ sessionItem.Timeout = timeout;
+ sessionItem.Locked = false;
+ sessionItem.SessionItems = string.Empty;
+ sessionItem.Flags = 0;
+
+ client.Set<SessionItem>(this.RedisKey(id), sessionItem, DateTime.UtcNow.AddMinutes(timeout));
+ }
+ }
+
+ public override SessionStateStoreData CreateNewStoreData(System.Web.HttpContext context, int timeout) {
+ return new SessionStateStoreData(new SessionStateItemCollection(),
+ SessionStateUtility.GetSessionStaticObjects(context),
+ timeout);
+ }
+
+ public override void ResetItemTimeout(HttpContext context, string id) {
+
+ using (RedisClient client = this.Repository.OpenRedisClient()) {
+ try {
+ // TODO :: GET THIS VALUE FROM THE CONFIG
+ client.ExpireEntryAt(id, DateTime.UtcNow.AddMinutes(sessionStateConfig.Timeout.TotalMinutes));
+ }
+ catch (Exception e) {
+ throw e;
+ }
+ }
+ }
+
+ public override void InitializeRequest(HttpContext context) {
+ // Was going to open the redis connection here but sometimes I had 5 connections open at one time which was strange
+ }
+
+ public override void EndRequest(HttpContext context) {
+ this.Dispose();
+ }
+ }
+}
View
41 RedisProvider/Views/Account/ChangePassword.cshtml
@@ -0,0 +1,41 @@
+@model RedisProvider.Models.ChangePasswordModel
+
+@{
+ ViewBag.Title = "Change Password";
+}
+
+<hgroup class="title">
+ <h1>@ViewBag.Title.</h1>
+ <h2>Use this form to change your password.</h2>
+</hgroup>
+
+<p class="message-info">
+ Passwords must be at least @Membership.MinRequiredPasswordLength characters long.
+</p>
+
+@using (Html.BeginForm()) {
+ @Html.ValidationSummary()
+
+ <fieldset>
+ <legend>Change Password Form</legend>
+ <ol>
+ <li>
+ @Html.LabelFor(m => m.OldPassword)
+ @Html.PasswordFor(m => m.OldPassword)
+ </li>
+ <li>
+ @Html.LabelFor(m => m.NewPassword)
+ @Html.PasswordFor(m => m.NewPassword)
+ </li>
+ <li>
+ @Html.LabelFor(m => m.ConfirmPassword)
+ @Html.PasswordFor(m => m.ConfirmPassword)
+ </li>
+ </ol>
+ <input type="submit" value="Change password" />
+ </fieldset>
+}
+
+@section Scripts {
+ @Scripts.Render("~/bundles/jqueryval")
+}
View
2  Web2/Views/Account/ChangePasswordSuccess.cshtml → ...ovider/Views/Account/ChangePasswordSuccess.cshtml
@@ -4,5 +4,5 @@
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
- <h2>Your password has been changed successfully.</h2>
+ <h2>Your password has been changed.</h2>
</hgroup>
View
15 Web2/Views/Account/Login.cshtml → RedisProvider/Views/Account/Login.cshtml
@@ -1,4 +1,4 @@
-@model Web2.Models.LoginModel
+@model RedisProvider.Models.LoginModel
@{
ViewBag.Title = "Log in";
@@ -6,13 +6,10 @@
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
- <h2>Enter your user name and password below.</h2>
+ <h2>Use this form to enter your user name and password.</h2>
</hgroup>
-<script src="~/Scripts/jquery.validate.min.js"></script>
-<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
-
-@using (Html.BeginForm((string)ViewBag.FormAction, "Account")) {
+@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
@Html.ValidationSummary(true, "Log in was unsuccessful. Please correct the errors and try again.")
<fieldset>
@@ -21,12 +18,10 @@
<li>
@Html.LabelFor(m => m.UserName)
@Html.TextBoxFor(m => m.UserName)
- @Html.ValidationMessageFor(m => m.UserName)
</li>
<li>
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
- @Html.ValidationMessageFor(m => m.Password)
</li>
<li>
@Html.CheckBoxFor(m => m.RememberMe)
@@ -39,3 +34,7 @@
@Html.ActionLink("Register", "Register") if you don't have an account.
</p>
}
+
+@section Scripts {
+ @Scripts.Render("~/bundles/jqueryval")
+}
View
21 Web2/Views/Account/Register.cshtml → RedisProvider/Views/Account/Register.cshtml
@@ -1,4 +1,4 @@
-@model Web2.Models.RegisterModel
+@model RedisProvider.Models.RegisterModel
@{
ViewBag.Title = "Register";
@@ -6,18 +6,15 @@
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
- <h2>Use the form below to create a new account.</h2>
+ <h2>Create a new account.</h2>
</hgroup>
<p class="message-info">
- Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length.
+ Passwords must be at least @Membership.MinRequiredPasswordLength characters long.
</p>
-<script src="~/Scripts/jquery.validate.min.js"></script>
-<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
-
-@using (Html.BeginForm((string)ViewBag.FormAction, "Account")) {
- @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
+@using (Html.BeginForm()) {
+ @Html.ValidationSummary()
<fieldset>
<legend>Registration Form</legend>
@@ -25,24 +22,24 @@
<li>
@Html.LabelFor(m => m.UserName)
@Html.TextBoxFor(m => m.UserName)
- @Html.ValidationMessageFor(m => m.UserName)
</li>
<li>
@Html.LabelFor(m => m.Email)
@Html.TextBoxFor(m => m.Email)
- @Html.ValidationMessageFor(m => m.Email)
</li>
<li>
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
- @Html.ValidationMessageFor(m => m.Password)
</li>
<li>
@Html.LabelFor(m => m.ConfirmPassword)
@Html.PasswordFor(m => m.ConfirmPassword)
- @Html.ValidationMessageFor(m => m.ConfirmPassword)
</li>
</ol>
<input type="submit" value="Register" />
</fieldset>
}
+
+@section Scripts {
+ @Scripts.Render("~/bundles/jqueryval")
+}
View
34 RedisProvider/Views/Home/About.cshtml
@@ -0,0 +1,34 @@
+@{
+ ViewBag.Title = "About";
+}
+
+<hgroup class="title">
+ <h1>@ViewBag.Title.</h1>
+ <h2>@ViewBag.Message</h2>
+</hgroup>
+
+<article>
+ <p>
+ Use this area to provide additional information.
+ </p>
+
+ <p>
+ Use this area to provide additional information.
+ </p>
+
+ <p>
+ Use this area to provide additional information.
+ </p>
+</article>
+
+<aside>
+ <h3>Aside Title</h3>
+ <p>
+ Use this area to provide additional information.
+ </p>
+ <ul>
+ <li>@Html.ActionLink("Home", "Index", "Home")</li>
+ <li>@Html.ActionLink("About", "About", "Home")</li>
+ <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
+ </ul>
+</aside>
View
6 Web2/Views/Home/Contact.cshtml → RedisProvider/Views/Home/Contact.cshtml
@@ -9,7 +9,7 @@
<section class="contact">
<header>
- <h3>Phone:</h3>
+ <h3>Phone</h3>
</header>
<p>
<span class="label">Main:</span>
@@ -23,7 +23,7 @@
<section class="contact">
<header>
- <h3>Email:</h3>
+ <h3>Email</h3>
</header>
<p>
<span class="label">Support:</span>
@@ -41,7 +41,7 @@
<section class="contact">
<header>
- <h3>Address:</h3>
+ <h3>Address</h3>
</header>
<p>
One Microsoft Way<br />
View
27 Web2/Views/Home/Index.cshtml → RedisProvider/Views/Home/Index.cshtml
@@ -1,9 +1,26 @@
-@model List<KeyValuePair<string, string>>
+@model List<KeyValuePair<string, string>>
@{
ViewBag.Title = "Home Page";
}
+
+@helper RenderRedisItems() {
+
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+
+ using (ServiceStack.Redis.RedisClient redisClient = new ServiceStack.Redis.RedisClient()) {
+ List<string> redisKeys = redisClient.GetAllKeys();
+
+ redisKeys.ForEach(delegate (string key) {
+ int time = redisClient.Ttl(key);
+ sb.Append("key: ").Append(key).Append(" time: ").Append(time).Append("<br />");
+ });
+ }
+
+ @sb.ToString()
+}
+
@section featured {
<section class="featured">
<div class="content-wrapper">
@@ -35,13 +52,7 @@
}
</section>
<section class="feature">
- <img src="~/Images/findHosting.png" alt="" />
- <h3>Find Web Hosting</h3>
- <p>
- You can easily find a web hosting company that offers the right mix of features and price for your applications.
- Visit <a href="http://microsoft.com/web/hosting" title="Microsoft/Web Website">Microsoft.com/web</a> to
- explore offerings from many providers.
- </p>
+ @Html.Raw(RenderRedisItems())
</section>
</section>
<script>
View
4 Web2/Views/Home/_sessionItems.cshtml → RedisProvider/Views/Home/_sessionItems.cshtml
@@ -5,10 +5,10 @@
System.Text.StringBuilder sb = new System.Text.StringBuilder();
this.Model.ForEach(delegate (KeyValuePair<string, string> currentItem) {
- sb.Append(currentItem.Key).Append(": ").Append(currentItem.Value);
+ sb.Append(currentItem.Key).Append(": ").Append(currentItem.Value).Append("<br />");
});
@sb.ToString();
}
-@WriteSessionsVariables()
+@Html.Raw(WriteSessionsVariables())
View
0  Web2/Views/Shared/Error.cshtml → RedisProvider/Views/Shared/Error.cshtml
File renamed without changes
View
13 Web2/Views/Shared/_Layout.cshtml → RedisProvider/Views/Shared/_Layout.cshtml
@@ -1,19 +1,19 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
- <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/css")" rel="stylesheet" type="text/css" />
- <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/themes/base/css")" rel="stylesheet" type="text/css" />
- <script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Scripts/js")"></script>
<meta name="viewport" content="width=device-width" />
+ <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/css")" rel="stylesheet" type="text/css" />
+ <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/themes/base/css")" rel="stylesheet" type="text/css" />
+ <script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Scripts/js")" type="text/javascript"></script>
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left">
- <p class="site-title">@Html.ActionLink("your logo here.", "Index", "Home")</p>
+ <p class="site-title">@Html.ActionLink("Your logo here", "Index", "Home")</p>
</div>
<div class="float-right">
<section id="login">
@@ -48,5 +48,8 @@
</div>
</div>
</footer>
+
+ @Scripts.Render("~/bundles/jquery")
+ @RenderSection("scripts", required: false)
</body>
</html>
View
4 Web2/Views/Shared/_LoginPartial.cshtml → RedisProvider/Views/Shared/_LoginPartial.cshtml
@@ -5,7 +5,7 @@
</p>
} else {
<ul>
- <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink", data_dialog_title = "Registration" })</li>
- <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink", data_dialog_title = "Identification" })</li>
+ <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
+ <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
</ul>
}
View
1  Web2/Views/Web.config → RedisProvider/Views/Web.config
@@ -15,6 +15,7 @@
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
+ <add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
View
0  Web2/Views/_ViewStart.cshtml → RedisProvider/Views/_ViewStart.cshtml
File renamed without changes
View
0  Web2/Web.Debug.config → RedisProvider/Web.Debug.config
File renamed without changes
View
0  Web2/Web.Release.config → RedisProvider/Web.Release.config
File renamed without changes
View
21 Web/Web.config → RedisProvider/Web.config
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
- http://go.microsoft.com/fwlink/?LinkId=152368
+ http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
+ <configSections>
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+ </configSections>
<connectionStrings>
- <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-Web-2012621215533;Integrated Security=True" providerName="System.Data.SqlClient" />
+ <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-RedisProvider-20120628173613;Integrated Security=SSPI" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
@@ -13,11 +17,12 @@
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
+ <add key="ApplicationName" value="RedisProvider" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
- <forms loginUrl="~/Account/Login" timeout="2880" />
+ <forms loginUrl="~/Account/Login" timeout="1" />
</authentication>
<pages>
<namespaces>
@@ -25,6 +30,7 @@
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
+ <add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
@@ -46,7 +52,7 @@
</roleManager>
<sessionState mode="Custom" customProvider="custom_provider" cookieless="false" timeout="1">
<providers>
- <add name="custom_provider" type="Web.SessionProvider.CustomServiceProvider" />
+ <add name="custom_provider" type="RedisProvider.SessionProvider.CustomServiceProvider" />
</providers>
</sessionState>
</system.web>
@@ -70,4 +76,11 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
+ <entityFramework>
+ <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+ <parameters>
+ <parameter value="v11.0" />
+ </parameters