Commits

Douglas Aguiar committed a8b57c2 Merge

versao 1.1

  • Participants
  • Parent commits 8fbe692, 93b5c1c

Comments (0)

Files changed (311)

.nuget/packages.config

+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="NuGet.CommandLine" version="2.7.3" />
+</packages>

AssemblyVersion.cs

 using System.Reflection;
 
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyInformationalVersion("1.1.0.0")]

LiteFx.EntityFramework/LiteFx.EntityFramework.csproj

 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>LiteFx.Context.EntityFramework</RootNamespace>
     <AssemblyName>LiteFx.EntityFramework</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>..\Debug\LiteFx.EntityFramework.XML</DocumentationFile>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>..\Release\LiteFx.EntityFramework.XML</DocumentationFile>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>false</SignAssembly>

LiteFx.NHibernate.Specs/LiteFx.NHibernate.Specs.csproj

 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>LiteFx.NHibernate.Specs</RootNamespace>
     <AssemblyName>LiteFx.NHibernate.Specs</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />

LiteFx.NHibernate/LiteFx.NHibernate.csproj

 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>LiteFx.Context.NHibernate</RootNamespace>
     <AssemblyName>LiteFx.NHibernate</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>..\Debug\LiteFx.NHibernate.XML</DocumentationFile>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>..\Release\LiteFx.NHibernate.xml</DocumentationFile>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>false</SignAssembly>
     <AssemblyOriginatorKeyFile>..\LiteFxKeyPair.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Castle.Core">
-      <HintPath>..\packages\Castle.Core.2.5.2\lib\NET35\Castle.Core.dll</HintPath>
+    <Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
     </Reference>
-    <Reference Include="FluentNHibernate">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\FluentNHibernate.1.2.0.712\lib\FluentNHibernate.dll</HintPath>
-    </Reference>
-    <Reference Include="Iesi.Collections">
-      <HintPath>..\packages\Iesi.Collections.3.1.0.4000\lib\Net35\Iesi.Collections.dll</HintPath>
+    <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
+      <HintPath>..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Practices.ServiceLocation">
       <HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
     </Reference>
-    <Reference Include="NHibernate">
+    <Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\NHibernate.3.1.0.4000\lib\Net35\NHibernate.dll</HintPath>
-    </Reference>
-    <Reference Include="NHibernate.ByteCode.Castle">
-      <HintPath>..\packages\NHibernate.Castle.3.1.0.4000\lib\Net35\NHibernate.ByteCode.Castle.dll</HintPath>
+      <HintPath>..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />

LiteFx.NHibernate/Properties/AssemblyInfo.cs

 using System.Reflection;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 // General Information about an assembly is controlled through the following 

LiteFx.NHibernate/SessionFactoryManager.cs

File contents unchanged.

LiteFx.NHibernate/SessionFactoryManager.cs.orig

+using System;
+using System.Threading;
+using Microsoft.Practices.ServiceLocation;
+using NHibernate;
+<<<<<<< local
+using NHibernate.Cfg;
+using NHibernate.Context;
+=======
+>>>>>>> other
+
+namespace LiteFx.Context.NHibernate
+{
+	public abstract class SessionFactoryManager
+	{
+		public static SessionFactoryManager Current
+		{
+			get
+			{
+				return ServiceLocator.Current.GetInstance<SessionFactoryManager>();
+			}
+		}
+
+		public SessionFactoryManager()
+		{
+			id = Guid.NewGuid();
+		}
+
+		private Guid id;
+		public Guid Id { get { return id; } }
+
+
+		private static Mutex _factoryMutex = new Mutex();
+
+		/// <summary>
+		/// Private sessionFactory.
+		/// </summary>
+		private static ISessionFactory sessionFactory;
+
+		/// <summary>
+		/// Propriedade privada para fazer o cache do sessionFactory do NHibernate.
+		/// </summary>
+		protected static ISessionFactory SessionFactory
+		{
+<<<<<<< local
+			get { return sessionFactory ?? (sessionFactory = Configuration.BuildSessionFactory()); }
+=======
+			get
+			{
+				if (sessionFactory == null)
+				{
+					_factoryMutex.WaitOne();
+					if (sessionFactory == null)
+					{
+						sessionFactory = ConfigurationManager.Configuration.BuildSessionFactory();
+					}
+					_factoryMutex.ReleaseMutex();
+				}
+				return sessionFactory;
+			}
+>>>>>>> other
+		}
+
+		private ISession session;
+
+		public virtual ISession GetCurrentSession()
+		{
+<<<<<<< local
+			_sessionMutex.WaitOne();
+			if (!CurrentSessionContext.HasBind(Current.SessionFactory))
+=======
+			if (session == null)
+>>>>>>> other
+			{
+				session = SessionFactory.OpenSession();
+				session.BeginTransaction();
+				//CurrentSessionContext.Bind(session);
+			}
+
+			return session;
+		}
+
+		public virtual void DisposeSession()
+		{
+			if (session != null)
+			{
+				//CurrentSessionContext.Unbind(SessionFactory);
+				session.Close();
+				session.Dispose();
+				session = null;
+			}
+		}
+
+		public virtual void CommitTransaction()
+		{
+			if (session != null)
+			{
+				if (session.Transaction.IsActive)
+					session.Transaction.Commit();
+			}
+		}
+
+		public virtual void RollbackTransaction()
+		{
+			if (session != null)
+			{
+				if (session.Transaction.IsActive)
+					session.Transaction.Rollback();
+			}
+		}
+
+		public virtual void Flush()
+		{
+			if (session != null)
+			{
+				session.Flush();
+			}
+		}
+	}
+}

LiteFx.NHibernate/packages.config

 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Castle.Core" version="2.5.2" targetFramework="net40" />
-  <package id="CommonServiceLocator" version="1.0" />
-  <package id="FluentNHibernate" version="1.2.0.712" targetFramework="net40" />
-  <package id="Iesi.Collections" version="3.1.0.4000" targetFramework="net40" />
-  <package id="NHibernate" version="3.1.0.4000" targetFramework="net40" />
-  <package id="NHibernate.Castle" version="3.1.0.4000" targetFramework="net40" />
+  <package id="CommonServiceLocator" version="1.0" requireReinstallation="True" />
+  <package id="FluentNHibernate" version="1.4.0.0" targetFramework="net451" />
+  <package id="Iesi.Collections" version="3.2.0.4000" targetFramework="net40" />
+  <package id="NHibernate" version="3.3.3.4001" targetFramework="net451" />
 </packages>

LiteFx.Raven.Tests/App.config

+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <connectionStrings>
+    <add name="RavenDb" connectionString="Url=http://localhost/raven"/>
+  </connectionStrings>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

LiteFx.Raven.Tests/LiteFx.Raven.Tests.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{90B2047C-7B6F-4968-8375-598EBD5FB31B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>LiteFx.Raven.Tests</RootNamespace>
+    <AssemblyName>LiteFx.Raven.Tests</AssemblyName>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="Raven.Abstractions">
+      <HintPath>..\packages\RavenDB.Client.2.5.2750\lib\net45\Raven.Abstractions.dll</HintPath>
+    </Reference>
+    <Reference Include="Raven.Client.Lightweight">
+      <HintPath>..\packages\RavenDB.Client.2.5.2750\lib\net45\Raven.Client.Lightweight.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="UnitTest1.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\LiteFx.Raven\LiteFx.Raven.csproj">
+      <Project>{7783B89B-7B1C-4445-B2D1-8ECA0644D4B0}</Project>
+      <Name>LiteFx.Raven</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config">
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\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>

LiteFx.Raven.Tests/Properties/AssemblyInfo.cs

+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("LiteFx.Raven.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("LiteFx.Raven.Tests")]
+[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("0c42b0ad-16d2-4b05-915d-d047ef20059f")]
+
+// 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.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

LiteFx.Raven.Tests/UnitTest1.cs

+using System.Linq;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace LiteFx.Raven.Tests
+{
+    [TestClass]
+    public class UnitTest1
+    {
+
+        [TestInitialize]
+        public void Setup() { SessionFactoryManager.Current.GetCurrentSession(); }
+
+        [TestMethod][Ignore]
+        public void TestMethod1()
+        {
+            var random = new System.Random();
+            for (int i = 0; i < 150; i++)
+            {
+                SessionFactoryManager.Current.GetCurrentSession().Store(new Usuario() { Nome = string.Format("Douglas Aguiar {0}", i), Email = "doaguiar@gmail.com", Idade = random.Next(12, 29) });
+            }
+
+            SessionFactoryManager.Current.CommitTransaction();
+        }
+
+        [TestMethod][Ignore]
+        public void select_usuarios_UsuariosMenoresDeIdade()
+        {
+            var list = SessionFactoryManager.Current.GetCurrentSession().Query<Usuario>("UsuariosMenoresDeIdade").ToList();
+
+            Assert.AreEqual(45, list.Count);
+        }
+
+        [TestMethod][Ignore]
+        public void select_usuarios_UsuariosMaioresDeIdade()
+        {
+            var list = SessionFactoryManager.Current.GetCurrentSession().Query<Usuario>("UsuariosMaioresDeIdade").ToList();
+
+            Assert.AreEqual(105, list.Count);
+        }
+
+        [TestMethod][Ignore]
+        public void select_usuarios()
+        {
+            var list = SessionFactoryManager.Current.GetCurrentSession().Query<Usuario>().Take(150).ToList();
+
+            Assert.AreEqual(150, list.Count);
+        }
+
+        public class Usuario
+        {
+            public int Id { get; set; }
+            public string Nome { get; set; }
+            public int Idade { get; set; }
+            public string Email { get; set; }
+        }
+    }
+}

LiteFx.Raven.Tests/packages.config

+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="RavenDB.Client" version="2.5.2750" targetFramework="net451" />
+</packages>

LiteFx.Raven/LiteFx.Raven.csproj

 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>LiteFx.Raven</RootNamespace>
     <AssemblyName>LiteFx.Raven</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="AsyncCtpLibrary">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\AsyncCtpLibrary.dll</HintPath>
-    </Reference>
     <Reference Include="Microsoft.Practices.ServiceLocation">
       <HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
     </Reference>
-    <Reference Include="Newtonsoft.Json">
-      <HintPath>..\packages\Newtonsoft.Json.4.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
-    </Reference>
-    <Reference Include="NLog">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\NLog.dll</HintPath>
-    </Reference>
     <Reference Include="Raven.Abstractions">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\Raven.Abstractions.dll</HintPath>
-    </Reference>
-    <Reference Include="Raven.Client.Debug">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\Raven.Client.Debug.dll</HintPath>
+      <HintPath>..\packages\RavenDB.Client.2.5.2750\lib\net45\Raven.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Raven.Client.Lightweight">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\Raven.Client.Lightweight.dll</HintPath>
-    </Reference>
-    <Reference Include="Raven.Client.MvcIntegration">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\Raven.Client.MvcIntegration.dll</HintPath>
-    </Reference>
-    <Reference Include="Raven.Json">
-      <HintPath>..\packages\RavenDB.1.0.0.427\lib\net40\Raven.Json.dll</HintPath>
+      <HintPath>..\packages\RavenDB.Client.2.5.2750\lib\net45\Raven.Client.Lightweight.dll</HintPath>
     </Reference>
     <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="..\AssemblyVersion.cs">
+      <Link>AssemblyVersion.cs</Link>
+    </Compile>
     <Compile Include="RavenContextAdapter.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SessionFactoryManager.cs" />

LiteFx.Raven/Properties/AssemblyInfo.cs

 using System.Reflection;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 // General Information about an assembly is controlled through the following 
 [assembly: ComVisible(false)]
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b4bfbd6b-5bd8-43fc-b0ed-52c6aaa8da9b")]
-
-// 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: Guid("b4bfbd6b-5bd8-43fc-b0ed-52c6aaa8da9b")]

LiteFx.Raven/RavenContextAdapter.cs

 
         public T Delete<T>(TId id)
         {
-            var doc = Session.Load<T>(id as ValueType);
+            T doc = default(T);
+            
+            if(id is string)
+                doc = Session.Load<T>(id as string);
+            else if(id is ValueType)
+                doc = Session.Load<T>(id as ValueType);
+
+            if (doc == null)
+                throw new InvalidOperationException(string.Format("The document id '{0}' does not exist in document store", id));
+
             Session.Delete(doc);
-            throw new NotImplementedException();
+            return doc;
         }
 
         public IQueryable<T> GetQueryableObject<T>() where T : class

LiteFx.Raven/SessionFactoryManager.cs

 
 namespace LiteFx.Raven
 {
-    public abstract class SessionFactoryManager
+    public class SessionFactoryManager
     {
-        private static SessionFactoryManager current;
+        protected static SessionFactoryManager current;
         public static SessionFactoryManager Current
         {
             get
             {
-                return current ?? (current = ServiceLocator.Current.GetInstance<SessionFactoryManager>());
+                //return current ?? (current = ServiceLocator.Current.GetInstance<SessionFactoryManager>());
+                return current ?? (current = new SessionFactoryManager());
             }
         }
 
-        protected abstract DocumentStore DocumentStore { get; }
+        protected static DocumentStore documentStore;
+        protected virtual DocumentStore DocumentStore
+        {
+            get
+            {
+                if (documentStore == null)
+                {
+                    documentStore = new DocumentStore();
+                    documentStore.ConnectionStringName = "RavenDb";
+                    documentStore.Initialize();
+                }
+
+                return documentStore;
+            }
+        }
+
+
         protected IDocumentSession Session { get; set; }
 
-        public IDocumentSession GetCurrentSession() 
+        public IDocumentSession GetCurrentSession()
         {
-            if (Session == null) 
+            if (Session == null)
             {
                 Session = DocumentStore.OpenSession();
             }
             if (Session != null && Session.Advanced.HasChanges)
             {
                 Session.SaveChanges();
+                Session.Dispose();
+            }
+        }
+
+        public virtual void RollbackTransaction()
+        {
+            DisposeSession();
+        }
+
+        public virtual void DisposeSession()
+        {
+            if (Session != null && Session.Advanced.HasChanges)
+            {
+                Session.Dispose();
             }
         }
     }

LiteFx.Raven/packages.config

 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="NLog" version="2.0.0.2000" />
-  <package id="Newtonsoft.Json" version="4.0.2" />
-  <package id="RavenDB" version="1.0.0.427" />
-  <package id="CommonServiceLocator" version="1.0" />
+  <package id="CommonServiceLocator" version="1.0" requireReinstallation="True" />
+  <package id="RavenDB.Client" version="2.5.2750" targetFramework="net451" />
 </packages>

LiteFx.Specs/App.config

-<?xml version="1.0" encoding="utf-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <configSections>
     <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/>
   </configSections>
   <specFlow>
-    <unitTestProvider name="MsTest" />
+    <unitTestProvider name="MsTest"/>
+    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
   </specFlow>
-</configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

LiteFx.Specs/DomainEventsSpecs/RaisingDomainEvents.feature.cs

-// ------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
 //  <auto-generated>
 //      This code was generated by SpecFlow (http://www.specflow.org/).
-//      SpecFlow Version:1.6.1.0
-//      SpecFlow Generator Version:1.6.0.0
-//      Runtime Version:4.0.30319.225
+//      SpecFlow Version:1.9.1.84
+//      SpecFlow Generator Version:1.9.0.0
+//      Runtime Version:4.0.30319.296
 // 
 //      Changes to this file may cause incorrect behavior and will be lost if
 //      the code is regenerated.
 //  </auto-generated>
 // ------------------------------------------------------------------------------
 #region Designer generated code
+#pragma warning disable
 namespace LiteFx.Specs.DomainEventsSpecs
 {
     using TechTalk.SpecFlow;
     
     
-    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.6.1.0")]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.1.84")]
     [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
     public partial class RasingDomaindEventsFeature
         {
             testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
             TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Rasing Domaind Events", "In order to alert all my domain\nAs a developer\nI want to raise events against the" +
-                    " model\nSo that the event could be handled", GenerationTargetLanguage.CSharp, ((string[])(null)));
+                    " model\nSo that the event could be handled", ProgrammingLanguage.CSharp, ((string[])(null)));
             testRunner.OnFeatureStart(featureInfo);
         }
         
             testRunner = null;
         }
         
-        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+        [Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute()]
+        public virtual void TestInitialize()
         {
-            testRunner.OnScenarioStart(scenarioInfo);
+            if (((TechTalk.SpecFlow.FeatureContext.Current != null) 
+                        && (TechTalk.SpecFlow.FeatureContext.Current.FeatureInfo.Title != "Rasing Domaind Events")))
+            {
+                LiteFx.Specs.DomainEventsSpecs.RasingDomaindEventsFeature.FeatureSetup(null);
+            }
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute()]
             testRunner.OnScenarioEnd();
         }
         
+        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+        {
+            testRunner.OnScenarioStart(scenarioInfo);
+        }
+        
+        public virtual void ScenarioCleanup()
+        {
+            testRunner.CollectScenarioErrors();
+        }
+        
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
         [Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute("Rasing and handling a Domain Event")]
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("FeatureTitle", "Rasing Domaind Events")]
 #line 7
 this.ScenarioSetup(scenarioInfo);
 #line 8
- testRunner.Given("I have registered a ordinary domain event handler into DomainEvent static class");
+ testRunner.Given("I have registered a ordinary domain event handler into DomainEvent static class", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 9
- testRunner.And("a ordinary subject");
+ testRunner.And("a ordinary subject", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 10
- testRunner.When("I set a value in the ordinary subject");
+ testRunner.When("I set a value in the ordinary subject", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 11
- testRunner.And("the ordinary event happen");
+ testRunner.And("the ordinary event happen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 12
- testRunner.Then("my handler should be called");
+ testRunner.Then("my handler should be called", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 14
 this.ScenarioSetup(scenarioInfo);
 #line 15
- testRunner.Given("I have registered a ordinary action into DomainEvent static class");
+ testRunner.Given("I have registered a ordinary action into DomainEvent static class", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 16
- testRunner.And("a ordinary subject");
+ testRunner.And("a ordinary subject", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 17
- testRunner.When("I set a value in the ordinary subject");
+ testRunner.When("I set a value in the ordinary subject", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 18
- testRunner.And("the ordinary event happen");
+ testRunner.And("the ordinary event happen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 19
- testRunner.Then("my action should be called");
+ testRunner.Then("my action should be called", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 22
 this.ScenarioSetup(scenarioInfo);
 #line 23
- testRunner.Given("I have registered a ordinary domain event handler into DomainEvent static class");
+ testRunner.Given("I have registered a ordinary domain event handler into DomainEvent static class", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 24
- testRunner.And("a ordinary subject");
+ testRunner.And("a ordinary subject", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 25
- testRunner.When("I set a value in the ordinary subject");
+ testRunner.When("I set a value in the ordinary subject", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 26
- testRunner.And("the ordinary event happen asynchronously");
+ testRunner.And("the ordinary event happen asynchronously", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 27
- testRunner.Then("my handler should be called");
+ testRunner.Then("my handler should be called", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
     }
 }
+#pragma warning restore
 #endregion

LiteFx.Specs/EntitySpecs/EntitiesEquality.feature.cs

-// ------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
 //  <auto-generated>
 //      This code was generated by SpecFlow (http://www.specflow.org/).
-//      SpecFlow Version:1.6.1.0
-//      SpecFlow Generator Version:1.6.0.0
-//      Runtime Version:4.0.30319.269
+//      SpecFlow Version:1.9.0.77
+//      SpecFlow Generator Version:1.9.0.0
+//      Runtime Version:4.0.30319.296
 // 
 //      Changes to this file may cause incorrect behavior and will be lost if
 //      the code is regenerated.
 //  </auto-generated>
 // ------------------------------------------------------------------------------
 #region Designer generated code
+#pragma warning disable
 namespace LiteFx.Specs.EntitySpecs
 {
     using TechTalk.SpecFlow;
     
     
-    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.6.1.0")]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")]
     [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
     public partial class EntitiesEqualityFeature
         {
             testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
             TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Entities Equality", "In order to compare to entities\nAs a developer\nI want that entities follows the r" +
-                    "ules of DDD", GenerationTargetLanguage.CSharp, ((string[])(null)));
+                    "ules of DDD", ProgrammingLanguage.CSharp, ((string[])(null)));
             testRunner.OnFeatureStart(featureInfo);
         }
         
             testRunner = null;
         }
         
-        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+        [Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute()]
+        public virtual void TestInitialize()
         {
-            testRunner.OnScenarioStart(scenarioInfo);
+            if (((TechTalk.SpecFlow.FeatureContext.Current != null) 
+                        && (TechTalk.SpecFlow.FeatureContext.Current.FeatureInfo.Title != "Entities Equality")))
+            {
+                LiteFx.Specs.EntitySpecs.EntitiesEqualityFeature.FeatureSetup(null);
+            }
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute()]
             testRunner.OnScenarioEnd();
         }
         
+        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+        {
+            testRunner.OnScenarioStart(scenarioInfo);
+        }
+        
+        public virtual void ScenarioCleanup()
+        {
+            testRunner.CollectScenarioErrors();
+        }
+        
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
         [Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute("Comparing two entities of the same type and id")]
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("FeatureTitle", "Entities Equality")]
 #line 6
 this.ScenarioSetup(scenarioInfo);
 #line 7
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 8
- testRunner.And("I have another product instance with the id 5");
+ testRunner.And("I have another product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 9
- testRunner.When("I compare the two instances");
+ testRunner.When("I compare the two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 10
- testRunner.Then("the equality should be true");
+ testRunner.Then("the equality should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 12
 this.ScenarioSetup(scenarioInfo);
 #line 13
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 14
- testRunner.And("I have another product instance with the id 10");
+ testRunner.And("I have another product instance with the id 10", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 15
- testRunner.When("I compare the two instances");
+ testRunner.When("I compare the two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 16
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 18
 this.ScenarioSetup(scenarioInfo);
 #line 19
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 20
- testRunner.And("I have a category instance with the id 5");
+ testRunner.And("I have a category instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 21
- testRunner.When("I compare the two instances");
+ testRunner.When("I compare the two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 22
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 24
 this.ScenarioSetup(scenarioInfo);
 #line 25
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 26
- testRunner.And("I have another product instance with the id 5");
+ testRunner.And("I have another product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 27
- testRunner.When("I compare the Hash Code of this two instances");
+ testRunner.When("I compare the Hash Code of this two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 28
- testRunner.Then("the equality should be true");
+ testRunner.Then("the equality should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 30
 this.ScenarioSetup(scenarioInfo);
 #line 31
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 32
- testRunner.And("I have another product instance with the id 10");
+ testRunner.And("I have another product instance with the id 10", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 33
- testRunner.When("I compare the Hash Code of this two instances");
+ testRunner.When("I compare the Hash Code of this two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 34
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 36
 this.ScenarioSetup(scenarioInfo);
 #line 37
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 38
- testRunner.And("I have a category instance with the id 5");
+ testRunner.And("I have a category instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 39
- testRunner.When("I compare the Hash Code of this two instances");
+ testRunner.When("I compare the Hash Code of this two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 40
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 42
 this.ScenarioSetup(scenarioInfo);
 #line 43
- testRunner.Given("I have a null product");
+ testRunner.Given("I have a null product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 44
- testRunner.And("I have another null product");
+ testRunner.And("I have another null product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 45
- testRunner.When("I compare the two instances");
+ testRunner.When("I compare the two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 46
- testRunner.Then("the equality should be true");
+ testRunner.Then("the equality should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 48
 this.ScenarioSetup(scenarioInfo);
 #line 49
- testRunner.Given("I have a null product");
+ testRunner.Given("I have a null product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 50
- testRunner.And("I have another product instance with the id 5");
+ testRunner.And("I have another product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 51
- testRunner.When("I compare the two instances");
+ testRunner.When("I compare the two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 52
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 54
 this.ScenarioSetup(scenarioInfo);
 #line 55
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 56
- testRunner.And("I have another null product");
+ testRunner.And("I have another null product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 57
- testRunner.When("I compare the two instances");
+ testRunner.When("I compare the two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 58
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 60
 this.ScenarioSetup(scenarioInfo);
 #line 61
- testRunner.Given("I have a product instance with the id 0");
+ testRunner.Given("I have a product instance with the id 0", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 62
- testRunner.And("I have another product instance with the id 0");
+ testRunner.And("I have another product instance with the id 0", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 63
- testRunner.When("I compare the Hash Code of this two instances");
+ testRunner.When("I compare the Hash Code of this two instances", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 64
- testRunner.Then("the equality should be false");
+ testRunner.Then("the equality should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 66
 this.ScenarioSetup(scenarioInfo);
 #line 67
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 68
- testRunner.And("I have another product instance with the id 5");
+ testRunner.And("I have another product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 69
- testRunner.And("a HashSet instance");
+ testRunner.And("a HashSet instance", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 70
- testRunner.When("I add the two instances to a HashSet");
+ testRunner.When("I add the two instances to a HashSet", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 71
- testRunner.Then("the HashSet count should be 1");
+ testRunner.Then("the HashSet count should be 1", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 73
 this.ScenarioSetup(scenarioInfo);
 #line 74
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 75
- testRunner.And("I have another product instance with the id 10");
+ testRunner.And("I have another product instance with the id 10", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 76
- testRunner.And("a HashSet instance");
+ testRunner.And("a HashSet instance", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 77
- testRunner.When("I add the two instances to a HashSet");
+ testRunner.When("I add the two instances to a HashSet", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 78
- testRunner.Then("the HashSet count should be 2");
+ testRunner.Then("the HashSet count should be 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 80
 this.ScenarioSetup(scenarioInfo);
 #line 81
- testRunner.Given("I have a product instance with the id 5");
+ testRunner.Given("I have a product instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 82
- testRunner.And("I have a category instance with the id 5");
+ testRunner.And("I have a category instance with the id 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 83
- testRunner.And("a HashSet instance");
+ testRunner.And("a HashSet instance", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 84
- testRunner.When("I add the two instances to a HashSet");
+ testRunner.When("I add the two instances to a HashSet", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 85
- testRunner.Then("the HashSet count should be 2");
+ testRunner.Then("the HashSet count should be 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
     }
 }
+#pragma warning restore
 #endregion

LiteFx.Specs/LambdaSpecificationSpecs/WorkingWithLambdaSpecifications.feature.cs

-// ------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
 //  <auto-generated>
 //      This code was generated by SpecFlow (http://www.specflow.org/).
-//      SpecFlow Version:1.6.1.0
-//      SpecFlow Generator Version:1.6.0.0
-//      Runtime Version:4.0.30319.225
+//      SpecFlow Version:1.9.1.84
+//      SpecFlow Generator Version:1.9.0.0
+//      Runtime Version:4.0.30319.296
 // 
 //      Changes to this file may cause incorrect behavior and will be lost if
 //      the code is regenerated.
 //  </auto-generated>
 // ------------------------------------------------------------------------------
 #region Designer generated code
+#pragma warning disable
 namespace LiteFx.Specs.LambdaSpecificationSpecs
 {
     using TechTalk.SpecFlow;
     
     
-    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.6.1.0")]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.1.84")]
     [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
     public partial class WorkingWithLambdaSpecificationsFeature
             testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
             TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Working with Lambda Specifications", "In order reuse ordinary rule im my domain\nAs a developer\nI want create specificat" +
                     "ion classes based in lambda\nSo That I could use these classes to validade rules " +
-                    "and performe queries", GenerationTargetLanguage.CSharp, ((string[])(null)));
+                    "and performe queries", ProgrammingLanguage.CSharp, ((string[])(null)));
             testRunner.OnFeatureStart(featureInfo);
         }
         
             testRunner = null;
         }
         
-        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+        [Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute()]
+        public virtual void TestInitialize()
         {
-            testRunner.OnScenarioStart(scenarioInfo);
+            if (((TechTalk.SpecFlow.FeatureContext.Current != null) 
+                        && (TechTalk.SpecFlow.FeatureContext.Current.FeatureInfo.Title != "Working with Lambda Specifications")))
+            {
+                LiteFx.Specs.LambdaSpecificationSpecs.WorkingWithLambdaSpecificationsFeature.FeatureSetup(null);
+            }
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute()]
             testRunner.OnScenarioEnd();
         }
         
+        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+        {
+            testRunner.OnScenarioStart(scenarioInfo);
+        }
+        
+        public virtual void ScenarioCleanup()
+        {
+            testRunner.CollectScenarioErrors();
+        }
+        
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
         [Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute("Checking if a discontinued Product is discontinued")]
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("FeatureTitle", "Working with Lambda Specifications")]
 #line 7
 this.ScenarioSetup(scenarioInfo);
 #line 8
- testRunner.Given("I have a discontinued Product");
+ testRunner.Given("I have a discontinued Product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 9
- testRunner.And("I have Product Discontinued Specification");
+ testRunner.And("I have Product Discontinued Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 10
- testRunner.When("I check if the product is discontinued");
+ testRunner.When("I check if the product is discontinued", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 11
- testRunner.Then("the result should be true");
+ testRunner.Then("the result should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 13
 this.ScenarioSetup(scenarioInfo);
 #line 14
- testRunner.Given("I have a discontinued Derived Product");
+ testRunner.Given("I have a discontinued Derived Product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 15
- testRunner.And("I have Product Discontinued Specification");
+ testRunner.And("I have Product Discontinued Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 16
- testRunner.When("I check if the product is discontinued");
+ testRunner.When("I check if the product is discontinued", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 17
- testRunner.Then("the result should be true");
+ testRunner.Then("the result should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 19
 this.ScenarioSetup(scenarioInfo);
 #line 20
- testRunner.Given("I have a not discontinued Product");
+ testRunner.Given("I have a not discontinued Product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 21
- testRunner.And("I have Product Discontinued Specification");
+ testRunner.And("I have Product Discontinued Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 22
- testRunner.When("I check if the product is discontinued");
+ testRunner.When("I check if the product is discontinued", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 23
- testRunner.Then("the result should be false");
+ testRunner.Then("the result should be false", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 25
 this.ScenarioSetup(scenarioInfo);
 #line 26
- testRunner.Given("I have a discontinued Product");
+ testRunner.Given("I have a discontinued Product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 27
- testRunner.And("I have Product Discontinued Specification");
+ testRunner.And("I have Product Discontinued Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 28
- testRunner.And("a Price Specification");
+ testRunner.And("a Price Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 29
- testRunner.When("I check if the product satisfy the two specifications");
+ testRunner.When("I check if the product satisfy the two specifications", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 30
- testRunner.Then("the result should be true");
+ testRunner.Then("the result should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 32
 this.ScenarioSetup(scenarioInfo);
 #line 33
- testRunner.Given("I have a not discontinued Product");
+ testRunner.Given("I have a not discontinued Product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 34
- testRunner.And("I have Product Discontinued Specification");
+ testRunner.And("I have Product Discontinued Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 35
- testRunner.And("a Price Specification");
+ testRunner.And("a Price Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 36
- testRunner.When("I check if the product satisfy one of the two specifications");
+ testRunner.When("I check if the product satisfy one of the two specifications", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 37
- testRunner.Then("the result should be true");
+ testRunner.Then("the result should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
 #line 39
 this.ScenarioSetup(scenarioInfo);
 #line 40
- testRunner.Given("I have a discontinued Product");
+ testRunner.Given("I have a discontinued Product", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
 #line 41
- testRunner.And("I have Product Discontinued Specification");
+ testRunner.And("I have Product Discontinued Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 42
- testRunner.And("a Price Specification");
+ testRunner.And("a Price Specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
 #line 43
- testRunner.When("I fluently check if the product satisfy the two specifications");
+ testRunner.When("I fluently check if the product satisfy the two specifications", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
 #line 44
- testRunner.Then("the result should be true");
+ testRunner.Then("the result should be true", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
 #line hidden
-            testRunner.CollectScenarioErrors();
+            this.ScenarioCleanup();
         }
         
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]