diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..412eeda
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2afe71a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,103 @@
+# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
+[Bb]in/
+[Oo]bj/
+
+# mstest test results
+TestResults
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+src/*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.log
+*.vspscc
+*.vssscc
+.builds
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Publish Web Output
+*.Publish.xml
+
+# NuGet Packages Directory
+packages
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+[Tt]est[Rr]esult*
+ClientBin
+[Ss]tyle[Cc]op.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config
new file mode 100644
index 0000000..67f8ea0
--- /dev/null
+++ b/.nuget/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe
new file mode 100644
index 0000000..4e719e4
Binary files /dev/null and b/.nuget/NuGet.exe differ
diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets
new file mode 100644
index 0000000..bda5bea
--- /dev/null
+++ b/.nuget/NuGet.targets
@@ -0,0 +1,143 @@
+
+
+
+ $(MSBuildProjectDirectory)\..\
+
+
+ false
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
+ $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
+ $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
+ $([System.IO.Path]::Combine($(SolutionDir), "packages"))
+
+
+
+
+ $(SolutionDir).nuget
+ packages.config
+ $(SolutionDir)packages
+
+
+
+
+ $(NuGetToolsPath)\nuget.exe
+ @(PackageSource)
+
+ "$(NuGetExePath)"
+ mono --runtime=v4.0.30319 $(NuGetExePath)
+
+ $(TargetDir.Trim('\\'))
+
+ -RequireConsent
+
+ $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)"
+ $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols
+
+
+
+ RestorePackages;
+ $(BuildDependsOn);
+
+
+
+
+ $(BuildDependsOn);
+ BuildPackage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NHibernate.Caches.Redis.sln b/NHibernate.Caches.Redis.sln
new file mode 100644
index 0000000..1d0f43a
--- /dev/null
+++ b/NHibernate.Caches.Redis.sln
@@ -0,0 +1,41 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Caches.Redis", "src\NHibernate.Caches.Redis\NHibernate.Caches.Redis.csproj", "{1B50164C-DB00-4109-A0D4-E2868ABFEDAF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Caches.Redis.Tests", "tests\NHibernate.Caches.Redis.Tests\NHibernate.Caches.Redis.Tests.csproj", "{A067C7D2-CF09-4F24-9848-5CE10DC48438}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{65D5F343-E913-4E44-AD77-C338437C9D68}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F5128A75-1A1D-4585-BB4E-A9E55D12D03C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F0732F96-D774-44A7-B51A-54AC1A278F99}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {1B50164C-DB00-4109-A0D4-E2868ABFEDAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1B50164C-DB00-4109-A0D4-E2868ABFEDAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1B50164C-DB00-4109-A0D4-E2868ABFEDAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1B50164C-DB00-4109-A0D4-E2868ABFEDAF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A067C7D2-CF09-4F24-9848-5CE10DC48438}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A067C7D2-CF09-4F24-9848-5CE10DC48438}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A067C7D2-CF09-4F24-9848-5CE10DC48438}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A067C7D2-CF09-4F24-9848-5CE10DC48438}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {1B50164C-DB00-4109-A0D4-E2868ABFEDAF} = {F5128A75-1A1D-4585-BB4E-A9E55D12D03C}
+ {A067C7D2-CF09-4F24-9848-5CE10DC48438} = {F0732F96-D774-44A7-B51A-54AC1A278F99}
+ EndGlobalSection
+EndGlobal
diff --git a/build/NHibernate.Caches.Redis.nuspec b/build/NHibernate.Caches.Redis.nuspec
new file mode 100644
index 0000000..e69de29
diff --git a/build/build.proj b/build/build.proj
new file mode 100644
index 0000000..e69de29
diff --git a/src/NHibernate.Caches.Redis/NHibernate.Caches.Redis.csproj b/src/NHibernate.Caches.Redis/NHibernate.Caches.Redis.csproj
new file mode 100644
index 0000000..2c2ac4b
--- /dev/null
+++ b/src/NHibernate.Caches.Redis/NHibernate.Caches.Redis.csproj
@@ -0,0 +1,80 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {1B50164C-DB00-4109-A0D4-E2868ABFEDAF}
+ Library
+ Properties
+ NHibernate.Caches.Redis
+ NHibernate.Caches.Redis
+ v4.0
+ 512
+ ..\
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll
+
+
+ ..\packages\NHibernate.3.3.1.4000\lib\Net35\NHibernate.dll
+
+
+ ..\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Common.dll
+
+
+ ..\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Interfaces.dll
+
+
+ ..\packages\ServiceStack.Redis.3.9.12\lib\net35\ServiceStack.Redis.dll
+
+
+ ..\packages\ServiceStack.Text.3.9.11\lib\net35\ServiceStack.Text.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/NHibernate.Caches.Redis/ObjectExtensions.cs b/src/NHibernate.Caches.Redis/ObjectExtensions.cs
new file mode 100644
index 0000000..894aab8
--- /dev/null
+++ b/src/NHibernate.Caches.Redis/ObjectExtensions.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace NHibernate.Caches.Redis
+{
+ static class ObjectExtensions
+ {
+ public static T ThrowIfNull(this T source)
+ where T : class
+ {
+ if (source == null) throw new ArgumentNullException();
+ return source;
+ }
+
+ public static T ThrowIfNull(this T source, string paramName)
+ {
+ if (source == null) throw new ArgumentNullException(paramName);
+ return source;
+ }
+ }
+}
diff --git a/src/NHibernate.Caches.Redis/Properties/AssemblyInfo.cs b/src/NHibernate.Caches.Redis/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..33e2f63
--- /dev/null
+++ b/src/NHibernate.Caches.Redis/Properties/AssemblyInfo.cs
@@ -0,0 +1,38 @@
+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("NHibernate.Caches.Redis")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("NHibernate.Caches.Redis")]
+[assembly: AssemblyCopyright("Copyright © 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("c3db6972-73e3-4a08-8a79-99e6c29d1d25")]
+
+// 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")]
+
+[assembly: InternalsVisibleTo("NHibernate.Caches.Redis.Tests")]
\ No newline at end of file
diff --git a/src/NHibernate.Caches.Redis/RedisCache.cs b/src/NHibernate.Caches.Redis/RedisCache.cs
new file mode 100644
index 0000000..3f85d80
--- /dev/null
+++ b/src/NHibernate.Caches.Redis/RedisCache.cs
@@ -0,0 +1,312 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NHibernate.Cache;
+using NHibernate.Util;
+using ServiceStack.Common;
+using ServiceStack.Redis;
+using ServiceStack.Redis.Support;
+using ServiceStack.Text;
+
+namespace NHibernate.Caches.Redis
+{
+ public class RedisCache : ICache
+ {
+ private const string CacheNamePrefix = "NHibernate-Cache:";
+
+ private static readonly IInternalLogger log;
+ private static Dictionary