Commit fd10fe7c authored by Nick Craver's avatar Nick Craver

A full CoreCLR/DNX friendly conversion

This eliminates the dual solutions and brings Contrib into the
project.json fold.
- Tests are ported to xUnit though SQLite is disabled on DNX due to
Issue #375 (Interop loads fail in the VS runner and  params are busted
regardless).
- Projects are consolidated down to what's currently possible with
project.json.
- Contrib moved to: Dapper.Contrib and Dapper.Tests.Contrib (so tests
appear at the end, no other reason vs. Dapper.Contrib.Tests)
- EF moved to: Dapper.EntityFramework(.StrongName)
- Rainbow moved to: Dapper.Rainbow
- SqlBuilder moved to: Dapper.SqlBuilder
- Packages are removed since it's not current-tooling friendly to keep
them (nor was it using them).
- xUnit implemented in Contrib via abstracts - this allow us to very
quickly add any database provider to the rig in a very concise way.
- Contrib unit tests fixed in various places - they were not
parallel-runner friendly
- Nuspecs removed, since they aren't used anymore (to eliminate
confusion)
- Removed speed tests for libraries that aren't on current versions of
.Net (what would we be comparing?)
- Perf tests moved to Dapper.Tests (consolidation from
Dapper.DNX.Tests), but aren't activated yet (no define)
parent 523f7c8d
......@@ -11,4 +11,5 @@ NuGet.exe
.docstats
*.ide/
*.lock.json
*.coverage
\ No newline at end of file
*.coverage
Test.DB.*
\ No newline at end of file
<?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)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{437F12A2-6AB5-43BF-86BA-DD62DE17C2A7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper</RootNamespace>
<AssemblyName>Dapper</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Client</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>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\Dapper.xml</DocumentationFile>
<UseVSHostingProcess>false</UseVSHostingProcess>
</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>
<DocumentationFile>bin\Release\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Dapper.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Async.cs">
<Link>SqlMapper.Async.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.Async.cs">
<Link>SqlMapper.GridReader.Async.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</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>
\ No newline at end of file
<?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)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DAF737E1-05B5-4189-A5AA-DAC6233B64D7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper</RootNamespace>
<AssemblyName>Dapper</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Client</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>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\Dapper.xml</DocumentationFile>
<UseVSHostingProcess>false</UseVSHostingProcess>
</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>
<DocumentationFile>bin\Release\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Async.cs">
<Link>SqlMapper.Async.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.Async.cs">
<Link>SqlMapper.GridReader.Async.cs</Link>
</Compile>
</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>
\ No newline at end of file
<?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>
<ProjectGuid>{7140725C-8898-4F58-B566-628A80DB4EFA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper</RootNamespace>
<AssemblyName>Dapper</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;ASYNC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\Dapper.xml</DocumentationFile>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;ASYNC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Dapper.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Async.cs">
<Link>SqlMapper.Async.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.Async.cs">
<Link>SqlMapper.GridReader.Async.cs</Link>
</Compile>
</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>
\ No newline at end of file
<?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>
<ProjectGuid>{0FFF5BC7-0A4B-4D87-835E-4FAD70937507}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper</RootNamespace>
<AssemblyName>Dapper</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;ASYNC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\Dapper.xml</DocumentationFile>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;ASYNC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Dapper.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper\CommandDefinition.cs">
<Link>CommandDefinition.cs</Link>
</Compile>
<Compile Include="..\Dapper\CommandFlags.cs">
<Link>CommandFlags.cs</Link>
</Compile>
<Compile Include="..\Dapper\CustomPropertyTypeMap.cs">
<Link>CustomPropertyTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DataTableHandler.cs">
<Link>DataTableHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\DbString.cs">
<Link>DbString.cs</Link>
</Compile>
<Compile Include="..\Dapper\DefaultTypeMap.cs">
<Link>DefaultTypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.CachedOutputSetters.cs">
<Link>DynamicParameters.CachedOutputSetters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.cs">
<Link>DynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\DynamicParameters.ParamInfo.cs">
<Link>DynamicParameters.ParamInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\ExplicitConstructorAttribute.cs">
<Link>ExplicitConstructorAttribute.cs</Link>
</Compile>
<Compile Include="..\Dapper\FeatureSupport.cs">
<Link>FeatureSupport.cs</Link>
</Compile>
<Compile Include="..\Dapper\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SimpleMemberMap.cs">
<Link>SimpleMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordHandler.cs">
<Link>SqlDataRecordHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlDataRecordListTVPParameter.cs">
<Link>SqlDataRecordListTVPParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.CacheInfo.cs">
<Link>SqlMapper.CacheInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.cs">
<Link>SqlMapper.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRow.cs">
<Link>SqlMapper.DapperRow.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DapperRowMetaObject.cs">
<Link>SqlMapper.DapperRowMetaObject.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DataTable.cs">
<Link>SqlMapper.DataTable.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DeserializerState.cs">
<Link>SqlMapper.DeserializerState.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.DontMap.cs">
<Link>SqlMapper.DontMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.cs">
<Link>SqlMapper.GridReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ICustomQueryParameter.cs">
<Link>SqlMapper.ICustomQueryParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Identity.cs">
<Link>SqlMapper.Identity.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IDynamicParameters.cs">
<Link>SqlMapper.IDynamicParameters.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IMemberMap.cs">
<Link>SqlMapper.IMemberMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterCallbacks.cs">
<Link>SqlMapper.IParameterCallbacks.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.IParameterLookup.cs">
<Link>SqlMapper.IParameterLookup.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeHandler.cs">
<Link>SqlMapper.ITypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.ITypeMap.cs">
<Link>SqlMapper.ITypeMap.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Link.cs">
<Link>SqlMapper.Link.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.LiteralToken.cs">
<Link>SqlMapper.LiteralToken.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Settings.cs">
<Link>SqlMapper.Settings.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandler.cs">
<Link>SqlMapper.TypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.TypeHandlerCache.cs">
<Link>SqlMapper.TypeHandlerCache.cs</Link>
</Compile>
<Compile Include="..\Dapper\TableValuedParameter.cs">
<Link>TableValuedParameter.cs</Link>
</Compile>
<Compile Include="..\Dapper\TypeExtensions.cs">
<Link>TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\Dapper\UdtTypeHandler.cs">
<Link>UdtTypeHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedDataReader.cs">
<Link>WrappedDataReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\WrappedReader.cs">
<Link>WrappedReader.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.Async.cs">
<Link>SqlMapper.Async.cs</Link>
</Compile>
<Compile Include="..\Dapper\SqlMapper.GridReader.Async.cs">
<Link>SqlMapper.GridReader.Async.cs</Link>
</Compile>
</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>
\ No newline at end of file
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("Dapper NET45")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Dapper NET45")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[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("ec9ad659-1358-4d01-be77-ce45cd40b2f8")]
// 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")]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProjectGuid>{302EC82F-A81B-48C5-B653-B5C75D2BD103}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Contrib</RootNamespace>
<AssemblyName>Dapper.Contrib</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<DocumentationFile>bin\Debug\Dapper.Contrib.XML</DocumentationFile>
</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>
<DocumentationFile>bin\Release\Dapper.Contrib.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.Contrib\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Dapper.Contrib\SqlMapperExtensions.cs">
<Link>SqlMapperExtensions.cs</Link>
</Compile>
<Compile Include="SqlMapperExtensionsAsync.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET45\Dapper NET45.csproj">
<Project>{0fff5bc7-0a4b-4d87-835e-4fad70937507}</Project>
<Name>Dapper NET45</Name>
</ProjectReference>
</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>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProjectGuid>{E5482A3B-2C2A-4907-9804-C191F18FA622}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Contrib.Tests</RootNamespace>
<AssemblyName>Dapper.Contrib.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MSSQL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.Contrib.Tests NET45\TestsAsync.cs">
<Link>TestsAsync.cs</Link>
</Compile>
<Compile Include="..\Dapper.Contrib.Tests\Assert.cs">
<Link>Assert.cs</Link>
</Compile>
<Compile Include="..\Dapper.Contrib.Tests\Tests.cs">
<Link>Tests.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET45\Dapper NET45.csproj">
<Project>{0fff5bc7-0a4b-4d87-835e-4fad70937507}</Project>
<Name>Dapper NET45</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.Contrib NET45\Dapper.Contrib NET45.csproj">
<Project>{302ec82f-a81b-48c5-b653-b5c75d2bd103}</Project>
<Name>Dapper.Contrib NET45</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj">
<Project>{bf782ef1-2b0f-42fa-9dd0-928454a94c6d}</Project>
<Name>Dapper.SqlBuilder</Name>
</ProjectReference>
</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>
\ No newline at end of file
using System;
using System.Data.SqlClient;
using System.Data.SqlServerCe;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace Dapper.Contrib.Tests
{
class Program
{
static void Main(string[] args)
{
SetupMsSqlDatabase();
SetupTables();
RunTests();
DropTables();
SetupTables();
RunAsyncTests();
Console.WriteLine("Press any key...");
Console.ReadKey();
}
private static void SetupMsSqlDatabase()
{
using (var connection = new SqlConnection("Data Source = .\\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI"))
{
connection.Open();
var exists = connection.Query<int>("SELECT count(*) FROM master.sys.databases WHERE name = @name",
new { name = "DapperContribMsSqlTests" }).First();
if (exists > 0)
{
connection.Execute("drop database DapperContribMsSqlTests");
}
connection.Execute("create database DapperContribMsSqlTests");
}
}
private static void DropTables()
{
using (var connection = new SqlConnection("Data Source = .\\SQLEXPRESS;Initial Catalog=DapperContribMsSqlTests;Integrated Security=SSPI"))
{
connection.Open();
connection.Execute("alter database DapperContribMsSqlTests set single_user with rollback immediate");
connection.Execute(@" drop table Stuff");
connection.Execute(@" drop table People ");
connection.Execute(@" drop table Users");
connection.Execute(@" drop table Automobiles ");
connection.Execute(@" drop table Results ");
connection.Execute(@" drop table ObjectX ");
connection.Execute(@" drop table ObjectY ");
}
Console.WriteLine("Created database");
}
private static void SetupTables()
{
using (var connection = new SqlConnection("Data Source = .\\SQLEXPRESS;Initial Catalog=DapperContribMsSqlTests;Integrated Security=SSPI"))
{
connection.Open();
connection.Execute(@" create table Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null) ");
connection.Execute(@" create table People (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@" create table Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Results (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, [Order] int not null) ");
connection.Execute(@" create table ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table ObjectY (ObjectYId int not null, Name nvarchar(100) not null) ");
}
Console.WriteLine("Created database");
}
private static void RunTests()
{
var tester = new Tests();
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
method.Invoke(tester, null);
Console.WriteLine(" - OK!");
}
}
private static void RunAsyncTests()
{
var tester = new TestsAsync();
foreach (var method in typeof(TestsAsync).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
Task.WaitAll((Task)method.Invoke(tester, null));
Console.WriteLine(" - OK!");
}
}
}
}
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("Dapper.Contrib.Tests NET45")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Dapper.Contrib.Tests NET45")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[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("2d6cdd3d-b94b-4cd4-842a-60c6e4c93c5c")]
// 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")]
using System;
using System.Collections.Generic;
using System.Linq;
namespace Dapper.Contrib.Tests
{
/// <summary>
/// Assert extensions borrowed from Sam's code in DapperTests
/// </summary>
static class Assert
{
public static void IsEqualTo<T>(this T obj, T other)
{
if (!obj.Equals(other))
{
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other));
}
}
public static void IsMoreThan(this int obj, int other)
{
if (obj < other)
{
throw new ApplicationException(string.Format("{0} should be larger than {1}", obj, other));
}
}
public static void IsMoreThan(this long obj, int other)
{
if (obj < other)
{
throw new ApplicationException(string.Format("{0} should be larger than {1}", obj, other));
}
}
public static void IsSequenceEqualTo<T>(this IEnumerable<T> obj, IEnumerable<T> other)
{
if (!obj.SequenceEqual(other))
{
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other));
}
}
public static void IsFalse(this bool b)
{
if (b)
{
throw new ApplicationException("Expected false");
}
}
public static void IsTrue(this bool b)
{
if (!b)
{
throw new ApplicationException("Expected true");
}
}
public static void IsNull(this object obj)
{
if (obj != null)
{
throw new ApplicationException("Expected null");
}
}
public static void IsNotNull(this object obj)
{
if (obj == null)
{
throw new ApplicationException("Expected not null");
}
}
}
}
\ No newline at end of file
<?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>{114C32A1-D726-4F64-B8AF-AFEDE728E0BC}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Contrib.Tests</RootNamespace>
<AssemblyName>Dapper.Contrib.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SQLITE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.98.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.Contrib.Tests NET45\TestsAsync.cs">
<Link>TestsAsync.cs</Link>
</Compile>
<Compile Include="..\Dapper.Contrib.Tests\Tests.cs">
<Link>Tests.cs</Link>
</Compile>
<Compile Include="Assert.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET45\Dapper NET45.csproj">
<Project>{0fff5bc7-0a4b-4d87-835e-4fad70937507}</Project>
<Name>Dapper NET45</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.Contrib NET45\Dapper.Contrib NET45.csproj">
<Project>{302ec82f-a81b-48c5-b653-b5c75d2bd103}</Project>
<Name>Dapper.Contrib NET45</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj">
<Project>{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}</Project>
<Name>Dapper.SqlBuilder</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="System.Data.SQLite.dll" />
<Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="x86\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="app.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>
\ No newline at end of file
using System;
using System.Data.SQLite;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
namespace Dapper.Contrib.Tests
{
class Program
{
static void Main(string[] args)
{
Setup();
RunTests();
Setup();
RunAsyncTests();
Console.WriteLine("Press any key...");
Console.ReadKey();
}
private static void Setup()
{
var projLoc = Assembly.GetAssembly(typeof(Program)).Location;
var projFolder = Path.GetDirectoryName(projLoc);
if (File.Exists(projFolder + "\\Test.sqlite"))
File.Delete(projFolder + "\\Test.sqlite");
SQLiteConnection.CreateFile(projFolder + "\\Test.sqlite");
var connectionString = "Data Source = " + projFolder + "\\Test.sqlite;";
using (var connection = new SQLiteConnection(connectionString))
{
connection.Open();
connection.Execute(@" create table Stuff (TheId integer primary key autoincrement not null, Name nvarchar(100) not null, Created DateTime null) ");
connection.Execute(@" create table People (Id integer primary key autoincrement not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Users (Id integer primary key autoincrement not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@" create table Automobiles (Id integer primary key autoincrement not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Results (Id integer primary key autoincrement not null, Name nvarchar(100) not null, [Order] int not null) ");
connection.Execute(@" create table ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table ObjectY (ObjectYId integer not null, Name nvarchar(100) not null) ");
}
Console.WriteLine("Created database");
}
private static void RunTests()
{
var tester = new Tests();
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
method.Invoke(tester, null);
Console.WriteLine(" - OK!");
}
}
private static void RunAsyncTests()
{
var tester = new TestsAsync();
foreach (var method in typeof(TestsAsync).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
Task.WaitAll((Task)method.Invoke(tester, null));
Console.WriteLine(" - OK!");
}
}
}
}
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProjectGuid>{7A85178F-4ADC-4E4C-BF08-17FC99488A9A}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Contrib.Tests</RootNamespace>
<AssemblyName>Dapper.Contrib.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</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|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.Contrib.Tests\Assert.cs">
<Link>Assert.cs</Link>
</Compile>
<Compile Include="..\Dapper.Contrib.Tests\Tests.cs">
<Link>Tests.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestsAsync.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET45\Dapper NET45.csproj">
<Project>{0fff5bc7-0a4b-4d87-835e-4fad70937507}</Project>
<Name>Dapper NET45</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.Contrib NET45\Dapper.Contrib NET45.csproj">
<Project>{302ec82f-a81b-48c5-b653-b5c75d2bd103}</Project>
<Name>Dapper.Contrib NET45</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj">
<Project>{bf782ef1-2b0f-42fa-9dd0-928454a94c6d}</Project>
<Name>Dapper.SqlBuilder</Name>
</ProjectReference>
</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>
\ No newline at end of file
using System;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
namespace Dapper.Contrib.Tests
{
class Program
{
static void Main(string[] args)
{
Setup();
RunTests();
Setup();
RunAsyncTests();
Console.WriteLine("Press any key...");
Console.ReadKey();
}
private static void Setup()
{
var projLoc = Assembly.GetAssembly(typeof(Program)).Location;
var projFolder = Path.GetDirectoryName(projLoc);
if (File.Exists(projFolder + "\\Test.sdf"))
File.Delete(projFolder + "\\Test.sdf");
var connectionString = "Data Source = " + projFolder + "\\Test.sdf;";
var engine = new SqlCeEngine(connectionString);
engine.CreateDatabase();
using (var connection = new SqlCeConnection(connectionString))
{
connection.Open();
connection.Execute(@" create table Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null) ");
connection.Execute(@" create table People (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@" create table Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Results (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, [Order] int not null) ");
connection.Execute(@" create table ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table ObjectY (ObjectYId int not null, Name nvarchar(100) not null) ");
}
Console.WriteLine("Created database");
}
private static void RunTests()
{
var tester = new Tests();
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
method.Invoke(tester, null);
Console.WriteLine(" - OK!");
}
}
private static void RunAsyncTests()
{
var tester = new TestsAsync();
foreach (var method in typeof(TestsAsync).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
Task.WaitAll((Task)method.Invoke(tester, null));
Console.WriteLine(" - OK!");
}
}
}
}
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("Dapper.Contrib.Tests NET45")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Dapper.Contrib.Tests NET45")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[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("2d6cdd3d-b94b-4cd4-842a-60c6e4c93c5c")]
// 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")]
using System;
using System.Collections.Generic;
using System.Linq;
namespace Dapper.Contrib.Tests
{
/// <summary>
/// Assert extensions borrowed from Sam's code in DapperTests
/// </summary>
static class Assert
{
public static void IsEqualTo<T>(this T obj, T other)
{
if (!obj.Equals(other))
{
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other));
}
}
public static void IsMoreThan(this int obj, int other)
{
if (obj < other)
{
throw new ApplicationException(string.Format("{0} should be larger than {1}", obj, other));
}
}
public static void IsMoreThan(this long obj, int other)
{
if (obj < other)
{
throw new ApplicationException(string.Format("{0} should be larger than {1}", obj, other));
}
}
public static void IsSequenceEqualTo<T>(this IEnumerable<T> obj, IEnumerable<T> other)
{
if (!obj.SequenceEqual(other))
{
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other));
}
}
public static void IsFalse(this bool b)
{
if (b)
{
throw new ApplicationException("Expected false");
}
}
public static void IsTrue(this bool b)
{
if (!b)
{
throw new ApplicationException("Expected true");
}
}
public static void IsNull(this object obj)
{
if (obj != null)
{
throw new ApplicationException("Expected null");
}
}
public static void IsNotNull(this object obj)
{
if (obj == null)
{
throw new ApplicationException("Expected not null");
}
}
}
}
\ No newline at end of file
<?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>{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Contrib.Tests</RootNamespace>
<AssemblyName>Dapper.Contrib.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</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="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Assert.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET40\Dapper NET40.csproj">
<Project>{daf737e1-05b5-4189-a5aa-dac6233b64d7}</Project>
<Name>Dapper NET40</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj">
<Project>{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}</Project>
<Name>Dapper.Contrib</Name>
</ProjectReference>
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj">
<Project>{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}</Project>
<Name>Dapper.SqlBuilder</Name>
</ProjectReference>
</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>
\ No newline at end of file
using System;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;
namespace Dapper.Contrib.Tests
{
class Program
{
static void Main(string[] args)
{
Setup();
RunTests();
Console.WriteLine("Press any key...");
Console.ReadKey();
}
private static void Setup()
{
var projLoc = Assembly.GetAssembly(typeof(Program)).Location;
var projFolder = Path.GetDirectoryName(projLoc);
if (File.Exists(projFolder + "\\Test.sdf"))
File.Delete(projFolder + "\\Test.sdf");
var connectionString = "Data Source = " + projFolder + "\\Test.sdf;";
var engine = new SqlCeEngine(connectionString);
engine.CreateDatabase();
using (var connection = new SqlCeConnection(connectionString))
{
connection.Open();
connection.Execute(@" create table Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null) ");
connection.Execute(@" create table People (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@" create table Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table Results (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, [Order] int not null) ");
connection.Execute(@" create table ObjectX (ObjectXId nvarchar(100) not null, Name nvarchar(100) not null) ");
connection.Execute(@" create table ObjectY (ObjectYId int not null, Name nvarchar(100) not null) ");
}
Console.WriteLine("Created database");
}
private static void RunTests()
{
var tester = new Tests();
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
method.Invoke(tester, null);
Console.WriteLine(" - OK!");
}
}
}
}
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("Dapper.Contrib.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Dapper.Contrib.Tests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[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("9d5920b6-d6af-41ca-b851-803ac922d933")]
// 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.40.0.0")]
[assembly: AssemblyFileVersion("1.40.0.0")]
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Dapper.Contrib</id>
<version>1.44</version>
<authors>Sam Saffron,Johan Danforth</authors>
<owners>Johan Danforth, Marc Gravell</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<projectUrl>https://github.com/StackExchange/dapper-dot-net</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>The official collection of get, insert, update and delete helpers for dapper.net. Also handles lists of entities and optional "dirty" tracking of interface-based entities.</description>
<tags>orm sql micro-orm dapper</tags>
<releaseNotes>
* 1.44 - Specific insert adapters for sql/sql ce. Faster inserts for sql server now
* 1.43 - GetDatebaseType delegate for Insert, TableNameMapper, Insert now handles closed connection and supports short/int16 id/key
* 1.42 - InsertAsync() UpdateAsync() and DeleteAsync() now also handles lists of entities (.NET 4.5 only)
* 1.41 - added GetAll(). Insert() Update() and Delete() now handles lists of entities!
* 1.40 - cumulative changes up to dapper 1.40; will track changes more carefully subsequently
</releaseNotes>
<dependencies>
<dependency id="Dapper" version="1.40" />
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.0-Client, .NETFramework4.0" />
<frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.0-Client, .NETFramework4.0" />
<frameworkAssembly assemblyName="System.Data" targetFramework=".NETFramework4.0-Client, .NETFramework4.0" />
<frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework=".NETFramework4.0-Client, .NETFramework4.0" />
</frameworkAssemblies>
</metadata>
<files>
<file src="Dapper.Contrib NET45\bin\Release\Dapper.Contrib.*" target="lib\net45" />
<file src="Dapper.Contrib\bin\Release\Dapper.Contrib.*" target="lib\net40" />
</files>
</package>
\ No newline at end of file
<?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)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.Contrib</RootNamespace>
<AssemblyName>Dapper.Contrib</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</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>
<DocumentationFile>bin\Debug\Dapper.Contrib.XML</DocumentationFile>
</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>
<DocumentationFile>bin\Release\Dapper.Contrib.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="SqlMapperExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET40\Dapper NET40.csproj">
<Project>{daf737e1-05b5-4189-a5aa-dac6233b64d7}</Project>
<Name>Dapper NET40</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Readme.md" />
</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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>df2e04fe-3540-4c28-b381-af39c25ff97b</ProjectGuid>
<RootNamespace>Dapper.Contrib</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
using System;
#if ASYNC
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
......@@ -8,6 +8,14 @@
using Dapper;
#if COREFX
using IDbTransaction = System.Data.Common.DbTransaction;
using IDbConnection = System.Data.Common.DbConnection;
using DataException = System.InvalidOperationException;
#else
using System.Data;
#endif
#pragma warning disable 1573, 1591 // xml comments
namespace Dapper.Contrib.Extensions
......@@ -43,7 +51,7 @@ public static partial class SqlMapperExtensions
var name = GetTableName(type);
// TODO: query information schema and only select fields that are both in information schema and underlying class / interface
sql = "select * from " + name + " where " + key.Name + " = @id";
sql = $"SELECT * FROM {name} WHERE {key.Name} = @id";
GetQueries[type.TypeHandle] = sql;
}
......@@ -51,7 +59,7 @@ public static partial class SqlMapperExtensions
dynParms.Add("@id", id);
if (!type.IsInterface)
if (!type.IsInterface())
return (await connection.QueryAsync<T>(sql, dynParms, transaction, commandTimeout).ConfigureAwait(false)).FirstOrDefault();
var res = (await connection.QueryAsync<dynamic>(sql, dynParms).ConfigureAwait(false)).FirstOrDefault() as IDictionary<string, object>;
......@@ -98,11 +106,11 @@ public static partial class SqlMapperExtensions
var name = GetTableName(type);
// TODO: query information schema and only select fields that are both in information schema and underlying class / interface
sql = "select * from " + name;
sql = "SELECT * FROM " + name;
GetQueries[cacheType.TypeHandle] = sql;
}
if (!type.IsInterface)
if (!type.IsInterface())
{
return await connection.QueryAsync<T>(sql, null, transaction, commandTimeout: commandTimeout);
}
......@@ -137,7 +145,7 @@ public static partial class SqlMapperExtensions
var type = typeof(T);
if (type.IsArray || type.IsGenericType)
if (type.IsArray || type.IsGenericType())
{
isList = true;
type = type.GetGenericArguments()[0];
......@@ -176,7 +184,7 @@ public static partial class SqlMapperExtensions
}
//insert list of entities
var cmd = String.Format("insert into {0} ({1}) values ({2})", name, sbColumnList, sbParameterList);
var cmd = $"INSERT INTO {name} ({sbColumnList}) values ({sbParameterList})";
return await connection.ExecuteAsync(cmd, entityToInsert, transaction, commandTimeout);
}
......@@ -197,7 +205,7 @@ public static partial class SqlMapperExtensions
var type = typeof(T);
if (type.IsArray || type.IsGenericType)
if (type.IsArray || type.IsGenericType())
type = type.GetGenericArguments()[0];
var keyProperties = KeyPropertiesCache(type);
......@@ -248,7 +256,7 @@ public static partial class SqlMapperExtensions
var type = typeof(T);
if (type.IsArray || type.IsGenericType)
if (type.IsArray || type.IsGenericType())
type = type.GetGenericArguments()[0];
var keyProperties = KeyPropertiesCache(type);
......@@ -299,7 +307,7 @@ public partial class SqlServerAdapter
{
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
{
var cmd = String.Format("insert into {0} ({1}) values ({2});select SCOPE_IDENTITY() id", tableName, columnList, parameterList);
var cmd = $"INSERT INTO {tableName} ({columnList}) values ({parameterList}); SELECT SCOPE_IDENTITY() id";
var multi = await connection.QueryMultipleAsync(cmd, entityToInsert, transaction, commandTimeout);
var first = multi.Read().FirstOrDefault();
......@@ -318,9 +326,9 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
public partial class SqlCeServerAdapter
{
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, string tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
{
var cmd = String.Format("insert into {0} ({1}) values ({2})", tableName, columnList, parameterList);
var cmd = $"INSERT INTO {tableName} ({columnList}) values ({parameterList})";
await connection.ExecuteAsync(cmd, entityToInsert, transaction, commandTimeout).ConfigureAwait(false);
var r = (await connection.QueryAsync<dynamic>("select @@IDENTITY id", transaction: transaction, commandTimeout: commandTimeout).ConfigureAwait(false)).ToList();
......@@ -337,14 +345,14 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
}
}
public partial class MySqlAdapter : ISqlAdapter
public partial class MySqlAdapter
{
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, string tableName,
string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
{
var cmd = String.Format("insert into {0} ({1}) values ({2})", tableName, columnList, parameterList);
var cmd = $"INSERT INTO {tableName} ({columnList}) VALUES ({parameterList})";
await connection.ExecuteAsync(cmd, entityToInsert, transaction, commandTimeout).ConfigureAwait(false);
var r = await connection.QueryAsync<dynamic>("select LAST_INSERT_ID()", transaction: transaction, commandTimeout: commandTimeout).ConfigureAwait(false);
var r = await connection.QueryAsync<dynamic>("SELECT LAST_INSERT_ID()", transaction: transaction, commandTimeout: commandTimeout).ConfigureAwait(false);
var id = r.First().id;
if (id == null) return 0;
......@@ -361,10 +369,10 @@ public partial class MySqlAdapter : ISqlAdapter
public partial class PostgresAdapter
{
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, string tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
{
var sb = new StringBuilder();
sb.AppendFormat("insert into {0} ({1}) values ({2})", tableName, columnList, parameterList);
sb.AppendFormat("INSERT INTO {0} ({1}) VALUES ({2})", tableName, columnList, parameterList);
// If no primary key then safe to assume a join table with not too much data to return
var propertyInfos = keyProperties as PropertyInfo[] ?? keyProperties.ToArray();
......@@ -400,10 +408,9 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
public partial class SQLiteAdapter
{
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, string tableName, string columnList, string parameterList, IEnumerable<PropertyInfo> keyProperties, object entityToInsert)
{
var cmd = String.Format("insert into {0} ({1}) values ({2}); select last_insert_rowid() id", tableName, columnList, parameterList);
var cmd = $"INSERT INTO {tableName} ({columnList}) VALUES ({parameterList}); SELECT last_insert_rowid() id";
var multi = await connection.QueryMultipleAsync(cmd, entityToInsert, transaction, commandTimeout);
var id = (int)multi.Read().First().id;
......@@ -416,3 +423,4 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
return id;
}
}
#endif
This diff is collapsed.
{
"authors": [ "Sam Saffron", "Johan Danforth" ],
"owners": [ "johandanforth", "marc.gravell", "nick.craver" ],
"projectUrl": "https://github.com/StackExchange/dapper-dot-net",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"summary": "Dapper.Contrib",
"description": "The official collection of get, insert, update and delete helpers for dapper.net. Also handles lists of entities and optional \"dirty\" tracking of interface-based entities.",
"version": "1.50-beta3",
"title": "Dapper.Contrib",
"tags": [ "orm", "sql", "micro-orm", "dapper" ],
"copyright": "2015 Stack Exchange, Inc.",
"dependencies": {
"Dapper": {
"version": "1.50-*",
"target": "project"
}
},
"compile": [
"**/*.cs",
"../Dapper/TypeExtensions.cs"
],
"compilationOptions": {
"warningsAsErrors": true
},
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0"
}
},
"net45": {
"compilationOptions": {
"define": [ "ASYNC" ]
},
"frameworkAssemblies": {
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0"
},
"dependencies": {
}
},
"dotnet5.4": {
"compilationOptions": {
"define": [ "ASYNC", "COREFX" ]
},
"dependencies": {
"System.Reflection.Emit": "4.0.1-*",
"System.Reflection.Emit.ILGeneration": "4.0.1-*",
"System.Reflection.Emit.Lightweight": "4.0.1-*",
"System.Runtime": "4.0.21-*"
}
}
}
}
\ No newline at end of file
#if ASYNC
using System;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
namespace DapperTests_NET45
{
class Program
{
static void Main()
{
RunTests();
Console.WriteLine("(end of tests; press any key)");
Console.ReadKey();
}
public static readonly string connectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True";
public static SqlConnection GetOpenConnection(bool mars = false)
{
var cs = connectionString;
if (mars)
{
SqlConnectionStringBuilder scsb = new SqlConnectionStringBuilder(cs);
scsb.MultipleActiveResultSets = true;
cs = scsb.ConnectionString;
}
var connection = new SqlConnection(cs);
connection.Open();
return connection;
}
public static SqlConnection GetClosedConnection()
{
return new SqlConnection(connectionString);
}
private static void RunTests()
{
var tester = new Tests();
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
Console.Write("Running " + method.Name);
try
{
method.Invoke(tester, null);
Console.WriteLine(" - OK!");
} catch(TargetInvocationException ex)
{
var inner = ex.InnerException;
if(inner is AggregateException && ((AggregateException)inner).InnerExceptions.Count == 1)
{
inner = ((AggregateException)inner).InnerExceptions.Single();
}
Console.WriteLine(" - ERR: " + inner.Message);
}
}
}
}
}
#endif
\ No newline at end of file
using System;
using System.Data.SqlClient;
using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using Xunit;
using Dapper;
namespace SqlMapper
{
#if EXTERNALS
[ServiceStack.DataAnnotations.Alias("Posts")]
[Soma.Core.Table(Name = "Posts")]
#endif
public class Post
{
#if EXTERNALS
[Soma.Core.Id(Soma.Core.IdKind.Identity)]
#endif
public int Id { get; set; }
public string Text { get; set; }
public DateTime CreationDate { get; set; }
public DateTime LastChangeDate { get; set; }
public int? Counter1 { get; set; }
public int? Counter2 { get; set; }
public int? Counter3 { get; set; }
public int? Counter4 { get; set; }
public int? Counter5 { get; set; }
public int? Counter6 { get; set; }
public int? Counter7 { get; set; }
public int? Counter8 { get; set; }
public int? Counter9 { get; set; }
}
class Program
{
public const string ConnectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True",
AppveyorConnectionStrng = @"Server=(local)\SQL2014;Database=master;User ID=sa;Password=Password12!",
OleDbConnectionString = "Provider=SQLOLEDB;Data Source=.;Initial Catalog=tempdb;Integrated Security=SSPI";
public static SqlConnection GetOpenConnection(bool mars = false)
{
var isAppveyor = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("Appveyor"));
var cs = isAppveyor ? AppveyorConnectionStrng : ConnectionString;
if (mars)
{
var scsb = new SqlConnectionStringBuilder(cs)
{
MultipleActiveResultSets = true
};
cs = scsb.ConnectionString;
}
var connection = new SqlConnection(cs);
connection.Open();
return connection;
}
public static SqlConnection GetClosedConnection()
{
return new SqlConnection(ConnectionString);
}
static void RunPerformanceTests()
{
#if PERF
var test = new PerformanceTests();
const int iterations = 500;
Console.WriteLine("Running {0} iterations that load up a post entity", iterations);
test.Run(iterations);
#else
Console.WriteLine("Performance tests have not been built; add the PERF symbol");
#endif
}
static void Main()
{
#if COREFX
Console.WriteLine("CoreCLR");
#else
Console.WriteLine(".NET: " + Environment.Version);
#endif
Console.WriteLine("Dapper: " + typeof(global::Dapper.SqlMapper).AssemblyQualifiedName);
#if DEBUG
int fail = 0, skip = 0, pass = 0, frameworkFail = 0;
var failNames = new List<string>();
RunTests<SqlMapper.Tests>(ref fail, ref skip, ref pass, ref frameworkFail, failNames);
#if ASYNC
RunTests<DapperTests_NET45.Tests>(ref fail, ref skip, ref pass, ref frameworkFail, failNames);
#endif
if (fail == 0)
{
Console.WriteLine("(all tests successful)");
}
else
{
Console.WriteLine("Failures:");
foreach (var failName in failNames)
{
Console.WriteLine(failName);
}
}
Console.WriteLine("Passed: {0}, Failed: {1}, Skipped: {2}, Framework-fail: {3}", pass, fail, skip, frameworkFail);
#else
EnsureDBSetup();
RunPerformanceTests();
#endif
#if COREFX
Console.WriteLine("(end of tests; press return)");
Console.ReadLine();
#else
Console.WriteLine("(end of tests; press any key)");
Console.ReadKey();
#endif
}
private static void EnsureDBSetup()
{
using (var cnn = GetOpenConnection())
{
var cmd = cnn.CreateCommand();
cmd.CommandText = @"
if (OBJECT_ID('Posts') is null)
begin
create table Posts
(
Id int identity primary key,
[Text] varchar(max) not null,
CreationDate datetime not null,
LastChangeDate datetime not null,
Counter1 int,
Counter2 int,
Counter3 int,
Counter4 int,
Counter5 int,
Counter6 int,
Counter7 int,
Counter8 int,
Counter9 int
)
set nocount on
declare @i int
declare @c int
declare @id int
set @i = 0
while @i <= 5001
begin
insert Posts ([Text],CreationDate, LastChangeDate) values (replicate('x', 2000), GETDATE(), GETDATE())
set @id = @@IDENTITY
set @i = @i + 1
end
end
";
cmd.Connection = cnn;
cmd.ExecuteNonQuery();
}
}
private static bool HasAttribute<T>(MemberInfo member) where T : Attribute
{
#if COREFX
return member.CustomAttributes.Any(x => x.AttributeType == typeof(T));
#else
return Attribute.IsDefined(member, typeof(T), true);
#endif
}
private static void RunTests<T>(ref int fail, ref int skip, ref int pass, ref int frameworkFail, List<string> failNames) where T : class, IDisposable, new()
{
var tester = new T();
using (tester as IDisposable)
{
MethodInfo[] methods = typeof(T).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
var activeTests = methods.Where(HasAttribute<ActiveTestAttribute>).ToArray();
if (activeTests.Length != 0) methods = activeTests;
foreach (var method in methods)
{
#if COREFX
var fact = (FactAttribute)method.GetCustomAttribute(typeof(FactAttribute));
#else
var fact = (FactAttribute)Attribute.GetCustomAttribute(method, typeof(FactAttribute));
#endif
if(fact == null)
{
Console.WriteLine(" - missing [Fact]");
fail++;
failNames.Add(method.Name);
continue;
}
if(!string.IsNullOrWhiteSpace(fact.Skip))
{
Console.WriteLine("Skipping " + method.Name);
skip++;
continue;
}
Console.Write("Running " + method.Name);
try
{
using (var t = new T())
{
method.Invoke(t, null);
}
Console.WriteLine(" - OK!");
pass++;
}
catch (TargetInvocationException tie)
{
Console.WriteLine(" - " + tie.InnerException.Message);
fail++;
failNames.Add(method.Name);
if (tie.InnerException is TypeInitializationException)
{
Console.WriteLine("> " + tie.InnerException.InnerException.Message);
}
}
catch (Exception ex)
{
fail++;
Console.WriteLine(" - " + ex.Message);
failNames.Add(method.Name);
}
}
Console.WriteLine();
}
}
}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class ActiveTestAttribute : Attribute {}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class FactUnlessCoreCLRAttribute : FactAttribute {
public FactUnlessCoreCLRAttribute(string url)
{
#if COREFX
Skip = $"CoreFX: {url}";
#endif
this.Url = url;
}
public string Url { get; private set; }
}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class FactLongRunningAttribute : FactAttribute
{
public FactLongRunningAttribute()
{
#if !LONG_RUNNING
Skip = $"Long running";
#endif
}
public string Url { get; private set; }
}
class FactUnlessCaseSensitiveDatabaseAttribute : FactAttribute
{
public FactUnlessCaseSensitiveDatabaseAttribute() : base()
{
if (IsCaseSensitive)
{
Skip = "Case sensitive database";
}
}
public static readonly bool IsCaseSensitive;
static FactUnlessCaseSensitiveDatabaseAttribute()
{
using (var conn = Program.GetOpenConnection())
{
try
{
conn.Execute("declare @i int; set @I = 1;");
}
catch (SqlException s)
{
if (s.Number == 137)
IsCaseSensitive = true;
else
throw;
}
}
}
}
}
This diff is collapsed.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24709.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Dapper", "Dapper\Dapper.xproj", "{088D8CC4-E71E-44B6-9B87-4060B043983D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Dapper.DNX.Tests", "Dapper.DNX.Tests\Dapper.DNX.Tests.xproj", "{2AD7E470-9AC1-4F0A-A8C6-F19EEA00593F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A34907DF-958A-4E4C-8491-84CF303FD13E}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.Config = NuGet.Config
Readme.md = Readme.md
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Dapper.StrongName", "Dapper.StrongName\Dapper.StrongName.xproj", "{6EF701B6-1611-47F1-8325-E9AE1489BD2B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{088D8CC4-E71E-44B6-9B87-4060B043983D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{088D8CC4-E71E-44B6-9B87-4060B043983D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{088D8CC4-E71E-44B6-9B87-4060B043983D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{088D8CC4-E71E-44B6-9B87-4060B043983D}.Release|Any CPU.Build.0 = Release|Any CPU
{2AD7E470-9AC1-4F0A-A8C6-F19EEA00593F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AD7E470-9AC1-4F0A-A8C6-F19EEA00593F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AD7E470-9AC1-4F0A-A8C6-F19EEA00593F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AD7E470-9AC1-4F0A-A8C6-F19EEA00593F}.Release|Any CPU.Build.0 = Release|Any CPU
{6EF701B6-1611-47F1-8325-E9AE1489BD2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EF701B6-1611-47F1-8325-E9AE1489BD2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EF701B6-1611-47F1-8325-E9AE1489BD2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EF701B6-1611-47F1-8325-E9AE1489BD2B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProjectGuid>{9ABD1B44-8EEB-4CA9-9ED2-A6C462DE4FBF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.EntityFramework</RootNamespace>
<AssemblyName>Dapper.EntityFramework</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<DocumentationFile>bin\Debug\Dapper.EntityFramework.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</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>
<DocumentationFile>bin\Release\Dapper.EntityFramework.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Dapper.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2-beta1\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2-beta1\lib\net40\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.SqlServer.Types.11.0.2\lib\net20\Microsoft.SqlServer.Types.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.EntityFramework NET45\DbGeographyHandler.cs">
<Link>DbGeographyHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\DbGeometryHandler.cs">
<Link>DbGeometryHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\Handlers.cs">
<Link>Handlers.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="SqlServerTypes\Loader.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET40 SNK\Dapper NET40 SNK.csproj">
<Project>{437f12a2-6ab5-43bf-86ba-dd62de17c2a7}</Project>
<Name>Dapper NET40 SNK</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x64\msvcr100.dll">
<Link>SqlServerTypes\x64\msvcr100.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x64\SqlServerSpatial110.dll">
<Link>SqlServerTypes\x64\SqlServerSpatial110.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x86\msvcr100.dll">
<Link>SqlServerTypes\x86\msvcr100.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x86\SqlServerSpatial110.dll">
<Link>SqlServerTypes\x86\SqlServerSpatial110.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SqlServerTypes\readme.htm" />
</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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.2-beta1" targetFramework="net40" />
<package id="Microsoft.SqlServer.Types" version="11.0.2" targetFramework="net40" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProjectGuid>{2544DFBA-7F64-4003-9C36-D8337F770A36}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.EntityFramework</RootNamespace>
<AssemblyName>Dapper.EntityFramework</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<DocumentationFile>bin\Debug\Dapper.EntityFramework.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</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>
<DocumentationFile>bin\Release\Dapper.EntityFramework.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2-beta1\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2-beta1\lib\net40\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.SqlServer.Types.11.0.2\lib\net20\Microsoft.SqlServer.Types.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.EntityFramework NET45\DbGeographyHandler.cs">
<Link>DbGeographyHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\DbGeometryHandler.cs">
<Link>DbGeometryHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\Handlers.cs">
<Link>Handlers.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="SqlServerTypes\Loader.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET40\Dapper NET40.csproj">
<Project>{daf737e1-05b5-4189-a5aa-dac6233b64d7}</Project>
<Name>Dapper NET40</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x64\msvcr100.dll">
<Link>SqlServerTypes\x64\msvcr100.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x64\SqlServerSpatial110.dll">
<Link>SqlServerTypes\x64\SqlServerSpatial110.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x86\msvcr100.dll">
<Link>SqlServerTypes\x86\msvcr100.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x86\SqlServerSpatial110.dll">
<Link>SqlServerTypes\x86\SqlServerSpatial110.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SqlServerTypes\readme.htm" />
</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>
\ No newline at end of file
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace SqlServerTypes
{
/// <summary>
/// Utility methods related to CLR Types for SQL Server
/// </summary>
internal class Utilities
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr LoadLibrary(string libname);
/// <summary>
/// Loads the required native assemblies for the current architecture (x86 or x64)
/// </summary>
/// <param name="rootApplicationPath">
/// Root path of the current application. Use Server.MapPath(".") for ASP.NET applications
/// and AppDomain.CurrentDomain.BaseDirectory for desktop applications.
/// </param>
public static void LoadNativeAssemblies(string rootApplicationPath)
{
var nativeBinaryPath = IntPtr.Size > 4
? Path.Combine(rootApplicationPath, @"SqlServerTypes\x64\")
: Path.Combine(rootApplicationPath, @"SqlServerTypes\x86\");
LoadNativeAssembly(nativeBinaryPath, "msvcr100.dll");
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial110.dll");
}
private static void LoadNativeAssembly(string nativeBinaryPath, string assemblyName)
{
var path = Path.Combine(nativeBinaryPath, assemblyName);
var ptr = LoadLibrary(path);
if (ptr == IntPtr.Zero)
{
throw new Exception(string.Format(
"Error loading {0} (ErrorCode: {1})",
assemblyName,
Marshal.GetLastWin32Error()));
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.2-beta1" targetFramework="net40" />
<package id="Microsoft.SqlServer.Types" version="11.0.2" targetFramework="net40" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProjectGuid>{7169A2C1-F57E-4288-B22D-52394DD2EC06}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dapper.EntityFramework</RootNamespace>
<AssemblyName>Dapper.EntityFramework</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<DocumentationFile>bin\Debug\Dapper.EntityFramework.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</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>
<DocumentationFile>bin\Release\Dapper.EntityFramework.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Dapper.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2-beta1\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2-beta1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.SqlServer.Types.11.0.2\lib\net20\Microsoft.SqlServer.Types.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Dapper.EntityFramework NET45\DbGeographyHandler.cs">
<Link>DbGeographyHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\DbGeometryHandler.cs">
<Link>DbGeometryHandler.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\Handlers.cs">
<Link>Handlers.cs</Link>
</Compile>
<Compile Include="..\Dapper.EntityFramework NET45\Properties\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="SqlServerTypes\Loader.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper NET45 SNK\Dapper NET45 SNK.csproj">
<Project>{7140725c-8898-4f58-b566-628a80db4efa}</Project>
<Name>Dapper NET45 SNK</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x64\msvcr100.dll">
<Link>SqlServerTypes\x64\msvcr100.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x64\SqlServerSpatial110.dll">
<Link>SqlServerTypes\x64\SqlServerSpatial110.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x86\msvcr100.dll">
<Link>SqlServerTypes\x86\msvcr100.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\packages\Microsoft.SqlServer.Types.11.0.2\nativeBinaries\x86\SqlServerSpatial110.dll">
<Link>SqlServerTypes\x86\SqlServerSpatial110.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SqlServerTypes\readme.htm" />
</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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.2-beta1" targetFramework="net45" />
<package id="Microsoft.SqlServer.Types" version="11.0.2" targetFramework="net45" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.2-beta1" targetFramework="net45" />
<package id="Microsoft.SqlServer.Types" version="11.0.2" targetFramework="net45" />
</packages>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.

namespace SqlMapper.Linq2Sql
namespace Dapper.Tests.Linq2Sql
{
public partial class Post
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment