├── .gitattributes ├── .gitignore ├── .hgignore ├── .hgtags ├── .nuget └── packages.config ├── Dapper - VS2012.sln ├── Dapper NET35 └── Dapper NET35.csproj ├── Dapper NET45 ├── Dapper NET45.csproj ├── SqlMapperAsync.cs └── dapper-async.nuspec ├── Dapper.Contrib.Tests ├── Assert.cs ├── Dapper.Contrib.Tests.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── Tests.cs ├── Dapper.Contrib ├── Dapper.Contrib.1.0.nupkg ├── Dapper.Contrib.csproj ├── Dapper.Contrib.nuspec ├── Properties │ └── AssemblyInfo.cs └── SqlMapperExtensions.cs ├── Dapper.Rainbow ├── Dapper.Rainbow.csproj ├── Dapper.Rainbow.nuspec ├── Database.cs ├── Properties │ └── AssemblyInfo.cs ├── Snapshotter.cs └── SqlCompactDatabase.cs ├── Dapper.SqlBuilder ├── Dapper.SqlBuilder.csproj ├── Properties │ └── AssemblyInfo.cs └── SqlBuilder.cs ├── Dapper.sln ├── Dapper ├── Dapper.csproj ├── Properties │ └── AssemblyInfo.cs ├── SqlMapper.cs └── dapper.nuspec ├── DapperTests NET35 ├── DapperTests NET35.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── Tests.cs └── app.config ├── DapperTests NET45 ├── App.config ├── DapperTests NET45.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── Tests.cs ├── License.txt ├── Packages.dgml ├── Readme.md ├── Tests ├── Assert.cs ├── DapperTests.csproj ├── EntityFramework │ ├── Model.Designer.cs │ └── Model.edmx ├── License.txt ├── Linq2Sql │ ├── DataClasses.dbml │ ├── DataClasses.dbml.layout │ ├── DataClasses.designer.cs │ └── Post.cs ├── Massive │ └── Massive.cs ├── NHibernate │ ├── Iesi.Collections.dll │ ├── LinFu.DynamicProxy.dll │ ├── NHibernate.ByteCode.LinFu.dll │ ├── NHibernate.dll │ ├── NHibernateHelper.cs │ ├── Post.hbm.xml │ └── hibernate.cfg.xml ├── OrmLite │ ├── ServiceStack.Common.dll │ ├── ServiceStack.Interfaces.dll │ ├── ServiceStack.OrmLite.SqlServer.dll │ ├── ServiceStack.OrmLite.dll │ └── ServiceStack.Text.dll ├── PerformanceTests.cs ├── PetaPoco │ └── PetaPoco.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── DataSources │ │ └── SqlMapper.EntityFramework.tempdbEntities1.datasource │ ├── Settings.Designer.cs │ └── Settings.settings ├── Simple.Data │ ├── Simple.Data.Ado.dll │ ├── Simple.Data.SqlServer.dll │ └── Simple.Data.dll ├── Soma │ ├── Soma.Core.IT.MsSql.dll │ ├── Soma.Core.IT.MsSqlCe.dll │ └── Soma.Core.dll ├── SubSonic │ ├── ActiveRecord.cs │ ├── ActiveRecord.tt │ ├── Context.cs │ ├── Context.tt │ ├── SQLServer.ttinclude │ ├── Settings.ttinclude │ ├── StoredProcedures.cs │ ├── StoredProcedures.tt │ ├── Structs.cs │ ├── Structs.tt │ └── SubSonic.Core.dll ├── Tests.cs ├── app.config ├── bltoolkit │ └── BLToolkit.4.dll └── packages.config └── packages ├── FSPowerPack.Community.2.0.0.0 ├── Content │ └── FSPowerPack_Example.fs.pp ├── FSPowerPack.Community.2.0.0.0.nupkg ├── Lib │ ├── Net20 │ │ ├── FSharp.PowerPack.Linq.dll │ │ ├── FSharp.PowerPack.Linq.xml │ │ ├── FSharp.PowerPack.Metadata.dll │ │ ├── FSharp.PowerPack.Metadata.xml │ │ ├── FSharp.PowerPack.dll │ │ └── FSharp.PowerPack.xml │ ├── Net40 │ │ ├── FSharp.PowerPack.Linq.dll │ │ ├── FSharp.PowerPack.Linq.xml │ │ ├── FSharp.PowerPack.Metadata.dll │ │ ├── FSharp.PowerPack.Metadata.xml │ │ ├── FSharp.PowerPack.Parallel.Seq.dll │ │ ├── FSharp.PowerPack.Parallel.Seq.xml │ │ ├── FSharp.PowerPack.dll │ │ └── FSharp.PowerPack.xml │ ├── sl3 │ │ ├── FSharp.PowerPack.Compatibility.dll │ │ └── FSharp.PowerPack.dll │ └── sl4 │ │ ├── FSharp.PowerPack.Compatibility.dll │ │ └── FSharp.PowerPack.dll └── Tools │ ├── FSharp.Compiler.CodeDom.dll │ ├── FSharp.Compiler.CodeDom.xml │ ├── FSharp.PowerPack.Build.Tasks.dll │ ├── FSharp.PowerPack.Build.Tasks.xml │ ├── FSharp.PowerPack.Compatibility.dll │ ├── FSharp.PowerPack.Compatibility.xml │ ├── FSharp.PowerPack.Linq.dll │ ├── FSharp.PowerPack.Linq.xml │ ├── FSharp.PowerPack.Metadata.dll │ ├── FSharp.PowerPack.Metadata.xml │ ├── FSharp.PowerPack.Parallel.Seq.dll │ ├── FSharp.PowerPack.Parallel.Seq.xml │ ├── FSharp.PowerPack.dll │ ├── FSharp.PowerPack.targets │ ├── FSharp.PowerPack.xml │ ├── fshtmldoc.exe │ ├── fslex.exe │ └── fsyacc.exe ├── Npgsql.2.0.11 └── lib │ ├── Net11 │ ├── Mono.Security.dll │ ├── Npgsql.XML │ └── Npgsql.dll │ ├── Net35 │ ├── Mono.Security.dll │ ├── Npgsql.XML │ └── Npgsql.dll │ └── Net40 │ ├── Mono.Security.dll │ ├── Npgsql.XML │ └── Npgsql.dll ├── SqlServerCompact.4.0.8482.1 ├── Content │ └── web.config.transform ├── NativeBinaries │ ├── amd64 │ │ ├── Microsoft.VC90.CRT │ │ │ ├── Microsoft.VC90.CRT.manifest │ │ │ ├── README_ENU.txt │ │ │ └── msvcr90.dll │ │ ├── sqlcecompact40.dll │ │ ├── sqlceer40EN.dll │ │ ├── sqlceme40.dll │ │ ├── sqlceqp40.dll │ │ └── sqlcese40.dll │ └── x86 │ │ ├── Microsoft.VC90.CRT │ │ ├── Microsoft.VC90.CRT.manifest │ │ ├── README_ENU.txt │ │ └── msvcr90.dll │ │ ├── sqlcecompact40.dll │ │ ├── sqlceer40EN.dll │ │ ├── sqlceme40.dll │ │ ├── sqlceqp40.dll │ │ └── sqlcese40.dll ├── SQLCE_EULA_ENU.rtf ├── SqlServerCompact.4.0.8482.1.nupkg ├── Tools │ ├── GetSqlCEPostBuildCmd.ps1 │ ├── install.ps1 │ └── uninstall.ps1 └── lib │ └── System.Data.SqlServerCe.dll └── repositories.config /.gitattributes: -------------------------------------------------------------------------------- 1 | *.doc diff=astextplain 2 | *.DOC diff=astextplain 3 | *.docx diff=astextplain 4 | *.DOCX diff=astextplain 5 | *.dot diff=astextplain 6 | *.DOT diff=astextplain 7 | *.pdf diff=astextplain 8 | *.PDF diff=astextplain 9 | *.rtf diff=astextplain 10 | *.RTF diff=astextplain 11 | 12 | *.jpg binary 13 | *.png binary 14 | *.gif binary 15 | 16 | *.cs -text diff=csharp 17 | *.vb -text 18 | *.c -text 19 | *.cpp -text 20 | *.cxx -text 21 | *.h -text 22 | *.hxx -text 23 | *.py -text 24 | *.rb -text 25 | *.java -text 26 | *.html -text 27 | *.htm -text 28 | *.css -text 29 | *.scss -text 30 | *.sass -text 31 | *.less -text 32 | *.js -text 33 | *.lisp -text 34 | *.clj -text 35 | *.sql -text 36 | *.php -text 37 | *.lua -text 38 | *.m -text 39 | *.asm -text 40 | *.erl -text 41 | *.fs -text 42 | *.fsx -text 43 | *.hs -text 44 | 45 | *.csproj -text merge=union 46 | *.vbproj -text merge=union 47 | *.fsproj -text merge=union 48 | *.dbproj -text merge=union 49 | *.sln -text merge=union 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.suo 2 | bin/ 3 | obj/ 4 | /*.user 5 | _Resharper* 6 | .hgtags 7 | NuGet.exe 8 | *.user 9 | *.nupkg 10 | .docstats 11 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | /*.suo 2 | bin/* 3 | obj/* 4 | /*.user 5 | glob:Dapper/NuGet.exe 6 | syntax: glob 7 | *.docstates 8 | glob:Dapper.Contrib/NuGet.exe 9 | *.nupkg 10 | */NuGet.exe 11 | _ReSharper.* 12 | -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | f4a04d92d07a1186974442dfeec1e9b44a221685 #nuget dapper release 1.5 2 | 924b2d19b9b8b86457076a532daca84848c8b9ad #nuget dapper 1.6 3 | f4a04d92d07a1186974442dfeec1e9b44a221685 #nuget dapper release 1.5 4 | 0000000000000000000000000000000000000000 #nuget dapper release 1.5 5 | 924b2d19b9b8b86457076a532daca84848c8b9ad #nuget dapper 1.6 6 | 0000000000000000000000000000000000000000 #nuget dapper 1.6 7 | -------------------------------------------------------------------------------- /.nuget/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Dapper - VS2012.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper", "Dapper\Dapper.csproj", "{DAF737E1-05B5-4189-A5AA-DAC6233B64D7}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests", "Tests\DapperTests.csproj", "{A2A80512-11F4-4028-A995-505463632C84}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib", "Dapper.Contrib\Dapper.Contrib.csproj", "{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib.Tests", "Dapper.Contrib.Tests\Dapper.Contrib.Tests.csproj", "{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.SqlBuilder", "Dapper.SqlBuilder\Dapper.SqlBuilder.csproj", "{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper NET45", "Dapper NET45\Dapper NET45.csproj", "{EDD52209-45E8-42BA-81C1-D39FA1F07646}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET45", "DapperTests NET45\DapperTests NET45.csproj", "{B7B69EE5-0E0D-4218-88DF-79E7D2355D26}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E043638B-9516-477C-A75A-254DD55D4113}" 19 | ProjectSection(SolutionItems) = preProject 20 | .nuget\packages.config = .nuget\packages.config 21 | EndProjectSection 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Any CPU = Debug|Any CPU 26 | Debug|Mixed Platforms = Debug|Mixed Platforms 27 | Debug|x86 = Debug|x86 28 | Release|Any CPU = Release|Any CPU 29 | Release|Mixed Platforms = Release|Mixed Platforms 30 | Release|x86 = Release|x86 31 | EndGlobalSection 32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 33 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 36 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 37 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|x86.ActiveCfg = Debug|Any CPU 38 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 41 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU 42 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|x86.ActiveCfg = Release|Any CPU 43 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|Any CPU.ActiveCfg = Debug|x86 44 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 45 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|Mixed Platforms.Build.0 = Debug|x86 46 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|x86.ActiveCfg = Debug|x86 47 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|x86.Build.0 = Debug|x86 48 | {A2A80512-11F4-4028-A995-505463632C84}.Release|Any CPU.ActiveCfg = Release|x86 49 | {A2A80512-11F4-4028-A995-505463632C84}.Release|Mixed Platforms.ActiveCfg = Release|x86 50 | {A2A80512-11F4-4028-A995-505463632C84}.Release|Mixed Platforms.Build.0 = Release|x86 51 | {A2A80512-11F4-4028-A995-505463632C84}.Release|x86.ActiveCfg = Release|x86 52 | {A2A80512-11F4-4028-A995-505463632C84}.Release|x86.Build.0 = Release|x86 53 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 54 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU 55 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 56 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 57 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|x86.ActiveCfg = Debug|Any CPU 58 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU 59 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Any CPU.Build.0 = Release|Any CPU 60 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 61 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Mixed Platforms.Build.0 = Release|Any CPU 62 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|x86.ActiveCfg = Release|Any CPU 63 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|Any CPU.ActiveCfg = Debug|x86 64 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 65 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|Mixed Platforms.Build.0 = Debug|x86 66 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|x86.ActiveCfg = Debug|x86 67 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|x86.Build.0 = Debug|x86 68 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Any CPU.ActiveCfg = Release|x86 69 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Mixed Platforms.ActiveCfg = Release|x86 70 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Mixed Platforms.Build.0 = Release|x86 71 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|x86.ActiveCfg = Release|x86 72 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|x86.Build.0 = Release|x86 73 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 74 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU 75 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 76 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 77 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|x86.ActiveCfg = Debug|Any CPU 78 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU 79 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Any CPU.Build.0 = Release|Any CPU 80 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 81 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Mixed Platforms.Build.0 = Release|Any CPU 82 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|x86.ActiveCfg = Release|Any CPU 83 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 84 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Debug|Any CPU.Build.0 = Debug|Any CPU 85 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 86 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 87 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Debug|x86.ActiveCfg = Debug|Any CPU 88 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Release|Any CPU.ActiveCfg = Release|Any CPU 89 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Release|Any CPU.Build.0 = Release|Any CPU 90 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 91 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Release|Mixed Platforms.Build.0 = Release|Any CPU 92 | {EDD52209-45E8-42BA-81C1-D39FA1F07646}.Release|x86.ActiveCfg = Release|Any CPU 93 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Debug|Any CPU.ActiveCfg = Debug|x86 94 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 95 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Debug|Mixed Platforms.Build.0 = Debug|x86 96 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Debug|x86.ActiveCfg = Debug|x86 97 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Debug|x86.Build.0 = Debug|x86 98 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Release|Any CPU.ActiveCfg = Release|x86 99 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Release|Mixed Platforms.ActiveCfg = Release|x86 100 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Release|Mixed Platforms.Build.0 = Release|x86 101 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Release|x86.ActiveCfg = Release|x86 102 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26}.Release|x86.Build.0 = Release|x86 103 | EndGlobalSection 104 | GlobalSection(SolutionProperties) = preSolution 105 | HideSolutionNode = FALSE 106 | EndGlobalSection 107 | EndGlobal 108 | -------------------------------------------------------------------------------- /Dapper NET35/Dapper NET35.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {B26305D8-3A89-4D68-A981-9BBF378B81FA} 9 | Library 10 | Properties 11 | Dapper 12 | Dapper 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | TRACE;DEBUG;CSHARP30 22 | prompt 23 | 4 24 | 3 25 | bin\Debug\Dapper.xml 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE;CSHARP30 32 | prompt 33 | 4 34 | 3 35 | bin\Release\Dapper.xml 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | AssemblyInfo.cs 45 | 46 | 47 | SqlMapper.cs 48 | 49 | 50 | 51 | 52 | 53 | 54 | 61 | -------------------------------------------------------------------------------- /Dapper NET45/Dapper NET45.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {EDD52209-45E8-42BA-81C1-D39FA1F07646} 7 | Library 8 | Properties 9 | Dapper 10 | Dapper 11 | v4.5 12 | 512 13 | 14 | 15 | true 16 | full 17 | false 18 | bin\Debug\ 19 | DEBUG;TRACE;CSHARP50 20 | prompt 21 | 4 22 | 23 | 24 | pdbonly 25 | true 26 | bin\Release\ 27 | TRACE;CSHARP50 28 | prompt 29 | 4 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | AssemblyInfo.cs 40 | 41 | 42 | SqlMapper.cs 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 57 | -------------------------------------------------------------------------------- /Dapper NET45/dapper-async.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dapper-Async 5 | 1.03 6 | Dapper dot net async 7 | Sam Saffron,Marc Gravell,Brandon Kaid 8 | Sam Saffron,Marc Gravell,Brandon Kaid 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | https://github.com/bkaid/dapper-dot-net 11 | false 12 | A fork of Dapper with additional QueryAsync methods using .NET Framework 4.5's Task-Based Asynchronous Pattern. 13 | Dapper QueryAsync methods 14 | Dapper Async Task await 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | * 1.03 - Added two more multi-mapper type parameters. 23 | * 1.02 - Added async versions of Query methods that do multi-mapping like QueryAsync<TFirst, TSecond, TReturn> 24 | * 1.01 - Updated code to use ExecuteReaderAsync on more generic DbCommand instead of SqlCommand. 25 | * 1.0 - Initial release. 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Dapper.Contrib.Tests/Assert.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Dapper.Contrib.Tests 6 | { 7 | /// 8 | /// Assert extensions borrowed from Sam's code in DapperTests 9 | /// 10 | static class Assert 11 | { 12 | public static void IsEqualTo(this T obj, T other) 13 | { 14 | if (!obj.Equals(other)) 15 | { 16 | throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other)); 17 | } 18 | } 19 | 20 | public static void IsSequenceEqualTo(this IEnumerable obj, IEnumerable other) 21 | { 22 | if (!obj.SequenceEqual(other)) 23 | { 24 | throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other)); 25 | } 26 | } 27 | 28 | public static void IsFalse(this bool b) 29 | { 30 | if (b) 31 | { 32 | throw new ApplicationException("Expected false"); 33 | } 34 | } 35 | 36 | public static void IsTrue(this bool b) 37 | { 38 | if (!b) 39 | { 40 | throw new ApplicationException("Expected true"); 41 | } 42 | } 43 | 44 | public static void IsNull(this object obj) 45 | { 46 | if (obj != null) 47 | { 48 | throw new ApplicationException("Expected null"); 49 | } 50 | } 51 | 52 | } 53 | } -------------------------------------------------------------------------------- /Dapper.Contrib.Tests/Dapper.Contrib.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5} 9 | Exe 10 | Properties 11 | Dapper.Contrib.Tests 12 | Dapper.Contrib.Tests 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | x86 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | 35 | 36 | x86 37 | pdbonly 38 | true 39 | bin\Release\ 40 | TRACE 41 | prompt 42 | 4 43 | 44 | 45 | 46 | 47 | 48 | False 49 | Dependencies\System.Data.SqlServerCe.dll 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB} 66 | Dapper.Contrib 67 | 68 | 69 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D} 70 | Dapper.SqlBuilder 71 | 72 | 73 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7} 74 | Dapper 75 | 76 | 77 | 78 | 85 | -------------------------------------------------------------------------------- /Dapper.Contrib.Tests/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SqlServerCe; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | 10 | namespace Dapper.Contrib.Tests 11 | { 12 | class Program 13 | { 14 | static void Main(string[] args) 15 | { 16 | Setup(); 17 | RunTests(); 18 | } 19 | 20 | private static void Setup() 21 | { 22 | var projLoc = Assembly.GetAssembly(typeof(Program)).Location; 23 | var projFolder = Path.GetDirectoryName(projLoc); 24 | 25 | if (File.Exists(projFolder + "\\Test.sdf")) 26 | File.Delete(projFolder + "\\Test.sdf"); 27 | var connectionString = "Data Source = " + projFolder + "\\Test.sdf;"; 28 | var engine = new SqlCeEngine(connectionString); 29 | engine.CreateDatabase(); 30 | using (var connection = new SqlCeConnection(connectionString)) 31 | { 32 | connection.Open(); 33 | connection.Execute(@" create table Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null) "); 34 | connection.Execute(@" create table Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) "); 35 | } 36 | Console.WriteLine("Created database"); 37 | } 38 | 39 | private static void RunTests() 40 | { 41 | var tester = new Tests(); 42 | foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) 43 | { 44 | Console.Write("Running " + method.Name); 45 | method.Invoke(tester, null); 46 | Console.WriteLine(" - OK!"); 47 | } 48 | Console.ReadKey(); 49 | } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Dapper.Contrib.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Dapper.Contrib.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Dapper.Contrib.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9d5920b6-d6af-41ca-b851-803ac922d933")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Dapper.Contrib.Tests/Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using System.Data.SqlServerCe; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using Dapper.Contrib.Extensions; 7 | using System.Collections.Generic; 8 | using System; 9 | using Dapper; 10 | 11 | 12 | namespace Dapper.Contrib.Tests 13 | { 14 | public interface IUser 15 | { 16 | [Key] 17 | int Id { get; set; } 18 | string Name { get; set; } 19 | int Age { get; set; } 20 | } 21 | 22 | public class User : IUser 23 | { 24 | public int Id { get; set; } 25 | public string Name { get; set; } 26 | public int Age { get; set; } 27 | } 28 | 29 | [Table("Automobiles")] 30 | public class Car 31 | { 32 | public int Id { get; set; } 33 | public string Name { get; set; } 34 | } 35 | 36 | public class Tests 37 | { 38 | private IDbConnection GetOpenConnection() 39 | { 40 | var projLoc = Assembly.GetAssembly(GetType()).Location; 41 | var projFolder = Path.GetDirectoryName(projLoc); 42 | 43 | var connection = new SqlCeConnection("Data Source = " + projFolder + "\\Test.sdf;"); 44 | connection.Open(); 45 | return connection; 46 | } 47 | 48 | public void TableName() 49 | { 50 | using (var connection = GetOpenConnection()) 51 | { 52 | // tests against "Automobiles" table (Table attribute) 53 | connection.Insert(new Car {Name = "Volvo"}); 54 | connection.Get(1).Name.IsEqualTo("Volvo"); 55 | connection.Update(new Car() {Id = 1, Name = "Saab"}).IsEqualTo(true); 56 | connection.Get(1).Name.IsEqualTo("Saab"); 57 | connection.Delete(new Car() {Id = 1}).IsEqualTo(true); 58 | connection.Get(1).IsNull(); 59 | } 60 | } 61 | 62 | public void TestSimpleGet() 63 | { 64 | using (var connection = GetOpenConnection()) 65 | { 66 | var id = connection.Insert(new User { Name = "Adama", Age = 10 }); 67 | var user = connection.Get(id); 68 | user.Id.IsEqualTo((int)id); 69 | user.Name.IsEqualTo("Adama"); 70 | connection.Delete(user); 71 | } 72 | } 73 | 74 | public void InsertGetUpdate() 75 | { 76 | using (var connection = GetOpenConnection()) 77 | { 78 | connection.Get(3).IsNull(); 79 | 80 | var id = connection.Insert(new User {Name = "Adam", Age = 10}); 81 | 82 | //get a user with "isdirty" tracking 83 | var user = connection.Get(id); 84 | user.Name.IsEqualTo("Adam"); 85 | connection.Update(user).IsEqualTo(false); //returns false if not updated, based on tracking 86 | user.Name = "Bob"; 87 | connection.Update(user).IsEqualTo(true); //returns true if updated, based on tracking 88 | user = connection.Get(id); 89 | user.Name.IsEqualTo("Bob"); 90 | 91 | //get a user with no tracking 92 | var notrackedUser = connection.Get(id); 93 | notrackedUser.Name.IsEqualTo("Bob"); 94 | connection.Update(notrackedUser).IsEqualTo(true); //returns true, even though user was not changed 95 | notrackedUser.Name = "Cecil"; 96 | connection.Update(notrackedUser).IsEqualTo(true); 97 | connection.Get(id).Name.IsEqualTo("Cecil"); 98 | 99 | connection.Query("select * from Users").Count().IsEqualTo(1); 100 | connection.Delete(user).IsEqualTo(true); 101 | connection.Query("select * from Users").Count().IsEqualTo(0); 102 | 103 | connection.Update(notrackedUser).IsEqualTo(false); //returns false, user not found 104 | } 105 | } 106 | 107 | public void InsertCheckKey() 108 | { 109 | using (var connection = GetOpenConnection()) 110 | { 111 | connection.Get(3).IsNull(); 112 | User user = new User { Name = "Adamb", Age = 10 }; 113 | int id = (int)connection.Insert(user); 114 | user.Id.IsEqualTo(id); 115 | } 116 | } 117 | 118 | public void BuilderSelectClause() 119 | { 120 | using (var connection = GetOpenConnection()) 121 | { 122 | var rand = new Random(8675309); 123 | var data = new List(); 124 | for (int i = 0; i < 100; i++) 125 | { 126 | var nU = new User { Age = rand.Next(70), Id = i, Name = Guid.NewGuid().ToString() }; 127 | data.Add(nU); 128 | nU.Id = (int)connection.Insert(nU); 129 | } 130 | 131 | var builder = new SqlBuilder(); 132 | var justId = builder.AddTemplate("SELECT /**select**/ FROM Users"); 133 | var all = builder.AddTemplate("SELECT Name, /**select**/, Age FROM Users"); 134 | 135 | builder.Select("Id"); 136 | 137 | var ids = connection.Query(justId.RawSql, justId.Parameters); 138 | var users = connection.Query(all.RawSql, all.Parameters); 139 | 140 | foreach (var u in data) 141 | { 142 | if (!ids.Any(i => u.Id == i)) throw new Exception("Missing ids in select"); 143 | if (!users.Any(a => a.Id == u.Id && a.Name == u.Name && a.Age == u.Age)) throw new Exception("Missing users in select"); 144 | } 145 | } 146 | } 147 | 148 | public void BuilderTemplateWOComposition() 149 | { 150 | var builder = new SqlBuilder(); 151 | var template = builder.AddTemplate("SELECT COUNT(*) FROM Users WHERE Age = @age", new {age = 5}); 152 | 153 | if (template.RawSql == null) throw new Exception("RawSql null"); 154 | if (template.Parameters == null) throw new Exception("Parameters null"); 155 | 156 | using (var connection = GetOpenConnection()) 157 | { 158 | connection.Insert(new User { Age = 5, Name = "Testy McTestington" }); 159 | 160 | if (connection.Query(template.RawSql, template.Parameters).Single() != 1) 161 | throw new Exception("Query failed"); 162 | } 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /Dapper.Contrib/Dapper.Contrib.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Dapper.Contrib/Dapper.Contrib.1.0.nupkg -------------------------------------------------------------------------------- /Dapper.Contrib/Dapper.Contrib.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB} 9 | Library 10 | Properties 11 | Dapper.Contrib 12 | Dapper.Contrib 13 | v4.0 14 | 512 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | true 26 | full 27 | false 28 | bin\Debug\ 29 | DEBUG;TRACE 30 | prompt 31 | 4 32 | 33 | 34 | pdbonly 35 | true 36 | bin\Release\ 37 | TRACE 38 | prompt 39 | 4 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7} 57 | Dapper 58 | 59 | 60 | 61 | 62 | 63 | 64 | 71 | -------------------------------------------------------------------------------- /Dapper.Contrib/Dapper.Contrib.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dapper.Contrib 5 | 1.1 6 | Sam Saffron,Johan Danforth 7 | Sam Saffron,Johan Danforth 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | http://code.google.com/p/dapper-dot-net/ 10 | false 11 | A collection of create,insert,update,delete helpers for dapper.net 12 | orm sql micro-orm 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Dapper.Contrib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Dapper.Contrib")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Dapper.Contrib")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6dde1c15-4e92-45e7-93fc-88778d15ff31")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Dapper.Rainbow/Dapper.Rainbow.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB} 9 | Library 10 | Properties 11 | Dapper.Rainbow 12 | Dapper.Rainbow 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7} 51 | Dapper 52 | 53 | 54 | 55 | 56 | Designer 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /Dapper.Rainbow/Dapper.Rainbow.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dapper.Rainbow 5 | 0.1.2 6 | Dapper.Rainbow 7 | Sam Saffron 8 | Sam Saffron 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | http://code.google.com/p/dapper-dot-net/ 11 | false 12 | 13 | Trivial micro-orm implemented on Dapper, provides with CRUD helpers. 14 | 15 | 16 | A demo is available at https://gist.github.com/1599013 . 17 | The implementation was extracted from http://data.stackexchange.com source at: http://code.google.com/p/stack-exchange-data-explorer/ . 18 | Data explorer uses "Rainbow" exclusively for all database access. 19 | 20 | 21 | * version 0.1: 22 | A demo is available at https://gist.github.com/1599013 . 23 | The implementation was extracted from http://data.stackexchange.com source at: http://code.google.com/p/stack-exchange-data-explorer/ . 24 | Data explorer uses "Rainbow" exclusively for all database access. 25 | 26 | Copyright Sam Saffron 2012 27 | orm dapper micro-orm 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Dapper.Rainbow/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Dapper.Rainbow")] 9 | [assembly: AssemblyDescription("I sample mini ORM implementation using Dapper")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Dapper.Rainbow")] 13 | [assembly: AssemblyCopyright("Sam Saffron Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e763c106-eef4-4654-afcc-c28fded057e5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.1.0.0")] 36 | [assembly: AssemblyFileVersion("0.1.0.0")] 37 | -------------------------------------------------------------------------------- /Dapper.Rainbow/Snapshotter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | License: http://www.apache.org/licenses/LICENSE-2.0 3 | Home page: http://code.google.com/p/dapper-dot-net/ 4 | */ 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Web; 10 | using System.Reflection; 11 | using System.Reflection.Emit; 12 | 13 | namespace Dapper 14 | { 15 | public static class Snapshotter 16 | { 17 | public static Snapshot Start(T obj) 18 | { 19 | return new Snapshot(obj); 20 | } 21 | 22 | public class Snapshot 23 | { 24 | static Func cloner; 25 | static Func> differ; 26 | T memberWiseClone; 27 | T trackedObject; 28 | 29 | public Snapshot(T original) 30 | { 31 | memberWiseClone = Clone(original); 32 | trackedObject = original; 33 | } 34 | 35 | public class Change 36 | { 37 | public string Name { get; set; } 38 | public object NewValue { get; set; } 39 | } 40 | 41 | public DynamicParameters Diff() 42 | { 43 | return Diff(memberWiseClone, trackedObject); 44 | } 45 | 46 | 47 | private static T Clone(T myObject) 48 | { 49 | cloner = cloner ?? GenerateCloner(); 50 | return cloner(myObject); 51 | } 52 | 53 | private static DynamicParameters Diff(T original, T current) 54 | { 55 | var dm = new DynamicParameters(); 56 | differ = differ ?? GenerateDiffer(); 57 | foreach (var pair in differ(original, current)) 58 | { 59 | dm.Add(pair.Name, pair.NewValue); 60 | } 61 | return dm; 62 | } 63 | 64 | 65 | static List RelevantProperties() 66 | { 67 | return typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public) 68 | .Where(p => 69 | p.GetSetMethod() != null && 70 | p.GetGetMethod() != null && 71 | (p.PropertyType.IsValueType || 72 | p.PropertyType == typeof(string) || 73 | (p.PropertyType.IsGenericType && p.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))) 74 | ).ToList(); 75 | } 76 | 77 | 78 | private static bool AreEqual(U first, U second) 79 | { 80 | if (first == null && second == null) return true; 81 | if (first == null && second != null) return false; 82 | return first.Equals(second); 83 | } 84 | 85 | private static Func> GenerateDiffer() 86 | { 87 | 88 | var dm = new DynamicMethod("DoDiff", typeof(List), new Type[] { typeof(T), typeof(T) }, true); 89 | 90 | var il = dm.GetILGenerator(); 91 | // change list 92 | il.DeclareLocal(typeof(List)); 93 | il.DeclareLocal(typeof(Change)); 94 | il.DeclareLocal(typeof(object)); // boxed change 95 | 96 | il.Emit(OpCodes.Newobj, typeof(List).GetConstructor(Type.EmptyTypes)); 97 | // [list] 98 | il.Emit(OpCodes.Stloc_0); 99 | 100 | foreach (var prop in RelevantProperties()) 101 | { 102 | // [] 103 | il.Emit(OpCodes.Ldarg_0); 104 | // [original] 105 | il.Emit(OpCodes.Callvirt, prop.GetGetMethod()); 106 | // [original prop val] 107 | il.Emit(OpCodes.Ldarg_1); 108 | // [original prop val, current] 109 | il.Emit(OpCodes.Callvirt, prop.GetGetMethod()); 110 | // [original prop val, current prop val] 111 | 112 | il.Emit(OpCodes.Dup); 113 | // [original prop val, current prop val, current prop val] 114 | 115 | if (prop.PropertyType != typeof(string)) 116 | { 117 | il.Emit(OpCodes.Box, prop.PropertyType); 118 | // [original prop val, current prop val, current prop val boxed] 119 | } 120 | 121 | il.Emit(OpCodes.Stloc_2); 122 | // [original prop val, current prop val] 123 | 124 | il.EmitCall(OpCodes.Call, typeof(Snapshot).GetMethod("AreEqual", BindingFlags.NonPublic | BindingFlags.Static).MakeGenericMethod(new Type[] { prop.PropertyType }), null); 125 | // [result] 126 | 127 | Label skip = il.DefineLabel(); 128 | il.Emit(OpCodes.Brtrue_S, skip); 129 | // [] 130 | 131 | il.Emit(OpCodes.Newobj, typeof(Change).GetConstructor(Type.EmptyTypes)); 132 | // [change] 133 | il.Emit(OpCodes.Dup); 134 | // [change,change] 135 | 136 | il.Emit(OpCodes.Stloc_1); 137 | // [change] 138 | 139 | il.Emit(OpCodes.Ldstr, prop.Name); 140 | // [change, name] 141 | il.Emit(OpCodes.Callvirt, typeof(Change).GetMethod("set_Name")); 142 | // [] 143 | 144 | il.Emit(OpCodes.Ldloc_1); 145 | // [change] 146 | 147 | il.Emit(OpCodes.Ldloc_2); 148 | // [change, boxed] 149 | 150 | il.Emit(OpCodes.Callvirt, typeof(Change).GetMethod("set_NewValue")); 151 | // [] 152 | 153 | il.Emit(OpCodes.Ldloc_0); 154 | // [change list] 155 | il.Emit(OpCodes.Ldloc_1); 156 | // [change list, change] 157 | il.Emit(OpCodes.Callvirt, typeof(List).GetMethod("Add")); 158 | // [] 159 | 160 | il.MarkLabel(skip); 161 | } 162 | 163 | il.Emit(OpCodes.Ldloc_0); 164 | // [change list] 165 | il.Emit(OpCodes.Ret); 166 | 167 | return (Func>)dm.CreateDelegate(typeof(Func>)); 168 | } 169 | 170 | 171 | // adapted from http://stackoverflow.com/a/966466/17174 172 | private static Func GenerateCloner() 173 | { 174 | Delegate myExec = null; 175 | var dm = new DynamicMethod("DoClone", typeof(T), new Type[] { typeof(T) }, true); 176 | var ctor = typeof(T).GetConstructor(new Type[] { }); 177 | 178 | var il = dm.GetILGenerator(); 179 | 180 | il.DeclareLocal(typeof(T)); 181 | 182 | il.Emit(OpCodes.Newobj, ctor); 183 | il.Emit(OpCodes.Stloc_0); 184 | 185 | foreach (var prop in RelevantProperties()) 186 | { 187 | il.Emit(OpCodes.Ldloc_0); 188 | // [clone] 189 | il.Emit(OpCodes.Ldarg_0); 190 | // [clone, source] 191 | il.Emit(OpCodes.Callvirt, prop.GetGetMethod()); 192 | // [clone, source val] 193 | il.Emit(OpCodes.Callvirt, prop.GetSetMethod()); 194 | // [] 195 | } 196 | 197 | // Load new constructed obj on eval stack -> 1 item on stack 198 | il.Emit(OpCodes.Ldloc_0); 199 | // Return constructed object. --> 0 items on stack 200 | il.Emit(OpCodes.Ret); 201 | 202 | myExec = dm.CreateDelegate(typeof(Func)); 203 | 204 | return (Func)myExec; 205 | } 206 | } 207 | } 208 | } 209 | 210 | -------------------------------------------------------------------------------- /Dapper.Rainbow/SqlCompactDatabase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.Common; 4 | using System.Linq; 5 | 6 | namespace Dapper.Rainbow 7 | { 8 | public abstract class SqlCompactDatabase : Database, IDisposable where TDatabase : Database, new() 9 | { 10 | public class SqlCompactTable : Table 11 | { 12 | public SqlCompactTable(Database database, string likelyTableName) 13 | : base(database, likelyTableName) 14 | { 15 | } 16 | 17 | /// 18 | /// Insert a row into the db 19 | /// 20 | /// Either DynamicParameters or an anonymous type or concrete type 21 | /// 22 | public override int? Insert(dynamic data) 23 | { 24 | var o = (object)data; 25 | List paramNames = GetParamNames(o); 26 | paramNames.Remove("Id"); 27 | 28 | string cols = string.Join(",", paramNames); 29 | string cols_params = string.Join(",", paramNames.Select(p => "@" + p)); 30 | 31 | var sql = "insert " + TableName + " (" + cols + ") values (" + cols_params + ")"; 32 | if (database.Execute(sql, o) != 1) 33 | { 34 | return null; 35 | } 36 | 37 | return (int)database.Query("SELECT @@IDENTITY AS LastInsertedId").Single(); 38 | } 39 | } 40 | 41 | public static TDatabase Init(DbConnection connection) 42 | { 43 | TDatabase db = new TDatabase(); 44 | db.InitDatabase(connection, 0); 45 | return db; 46 | } 47 | 48 | internal override Action CreateTableConstructorForTable() 49 | { 50 | return CreateTableConstructor(typeof(SqlCompactTable<>)); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Dapper.SqlBuilder/Dapper.SqlBuilder.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D} 9 | Library 10 | Properties 11 | Dapper.SqlBuilder 12 | Dapper.SqlBuilder 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7} 49 | Dapper 50 | 51 | 52 | 53 | 60 | -------------------------------------------------------------------------------- /Dapper.SqlBuilder/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Dapper.SqlBuilder")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Dapper.SqlBuilder")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("27491c26-c95d-44e5-b907-30559ef11265")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Dapper.SqlBuilder/SqlBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Dapper 7 | { 8 | public class SqlBuilder 9 | { 10 | Dictionary data = new Dictionary(); 11 | int seq; 12 | 13 | class Clause 14 | { 15 | public string Sql { get; set; } 16 | public object Parameters { get; set; } 17 | } 18 | 19 | class Clauses : List 20 | { 21 | string joiner; 22 | string prefix; 23 | string postfix; 24 | 25 | public Clauses(string joiner, string prefix = "", string postfix = "") 26 | { 27 | this.joiner = joiner; 28 | this.prefix = prefix; 29 | this.postfix = postfix; 30 | } 31 | 32 | public string ResolveClauses(DynamicParameters p) 33 | { 34 | foreach (var item in this) 35 | { 36 | p.AddDynamicParams(item.Parameters); 37 | } 38 | return prefix + string.Join(joiner, this.Select(c => c.Sql)) + postfix; 39 | } 40 | } 41 | 42 | public class Template 43 | { 44 | readonly string sql; 45 | readonly SqlBuilder builder; 46 | readonly object initParams; 47 | int dataSeq = -1; // Unresolved 48 | 49 | public Template(SqlBuilder builder, string sql, dynamic parameters) 50 | { 51 | this.initParams = parameters; 52 | this.sql = sql; 53 | this.builder = builder; 54 | } 55 | 56 | static System.Text.RegularExpressions.Regex regex = 57 | new System.Text.RegularExpressions.Regex(@"\/\*\*.+\*\*\/", System.Text.RegularExpressions.RegexOptions.Compiled | System.Text.RegularExpressions.RegexOptions.Multiline); 58 | 59 | void ResolveSql() 60 | { 61 | if (dataSeq != builder.seq) 62 | { 63 | DynamicParameters p = new DynamicParameters(initParams); 64 | 65 | rawSql = sql; 66 | 67 | foreach (var pair in builder.data) 68 | { 69 | rawSql = rawSql.Replace("/**" + pair.Key + "**/", pair.Value.ResolveClauses(p)); 70 | } 71 | parameters = p; 72 | 73 | // replace all that is left with empty 74 | rawSql = regex.Replace(rawSql, ""); 75 | 76 | dataSeq = builder.seq; 77 | } 78 | } 79 | 80 | string rawSql; 81 | object parameters; 82 | 83 | public string RawSql { get { ResolveSql(); return rawSql; } } 84 | public object Parameters { get { ResolveSql(); return parameters; } } 85 | } 86 | 87 | 88 | public SqlBuilder() 89 | { 90 | } 91 | 92 | public Template AddTemplate(string sql, dynamic parameters = null) 93 | { 94 | return new Template(this, sql, parameters); 95 | } 96 | 97 | void AddClause(string name, string sql, object parameters, string joiner, string prefix = "", string postfix = "") 98 | { 99 | Clauses clauses; 100 | if (!data.TryGetValue(name, out clauses)) 101 | { 102 | clauses = new Clauses(joiner, prefix, postfix); 103 | data[name] = clauses; 104 | } 105 | clauses.Add(new Clause { Sql = sql, Parameters = parameters }); 106 | seq++; 107 | } 108 | 109 | public SqlBuilder InnerJoin(string sql, dynamic parameters = null) 110 | { 111 | AddClause("innerjoin", sql, parameters, joiner: "\nINNER JOIN ", prefix: "\nINNER JOIN ", postfix: "\n"); 112 | return this; 113 | } 114 | 115 | public SqlBuilder LeftJoin(string sql, dynamic parameters = null) 116 | { 117 | AddClause("leftjoin", sql, parameters, joiner: "\nLEFT JOIN ", prefix: "\nLEFT JOIN ", postfix: "\n"); 118 | return this; 119 | } 120 | 121 | public SqlBuilder RightJoin(string sql, dynamic parameters = null) 122 | { 123 | AddClause("rightjoin", sql, parameters, joiner: "\nRIGHT JOIN ", prefix: "\nRIGHT JOIN ", postfix: "\n"); 124 | return this; 125 | } 126 | 127 | public SqlBuilder Where(string sql, dynamic parameters = null) 128 | { 129 | AddClause("where", sql, parameters, " AND ", prefix: "WHERE ", postfix: "\n"); 130 | return this; 131 | } 132 | 133 | public SqlBuilder OrderBy(string sql, dynamic parameters = null) 134 | { 135 | AddClause("orderby", sql, parameters, " , ", prefix: "ORDER BY ", postfix: "\n"); 136 | return this; 137 | } 138 | 139 | public SqlBuilder Select(string sql, dynamic parameters = null) 140 | { 141 | AddClause("select", sql, parameters, " , ", prefix: "", postfix: "\n"); 142 | return this; 143 | } 144 | 145 | public SqlBuilder AddParameters(dynamic parameters) 146 | { 147 | AddClause("--parameters", "", parameters, ""); 148 | return this; 149 | } 150 | 151 | public SqlBuilder Join(string sql, dynamic parameters = null) 152 | { 153 | AddClause("join", sql, parameters, joiner: "\nJOIN ", prefix: "\nJOIN ", postfix: "\n"); 154 | return this; 155 | } 156 | 157 | public SqlBuilder GroupBy(string sql, dynamic parameters = null) 158 | { 159 | AddClause("groupby", sql, parameters, joiner: " , ", prefix: "\nGROUP BY ", postfix: "\n"); 160 | return this; 161 | } 162 | 163 | public SqlBuilder Having(string sql, dynamic parameters = null) 164 | { 165 | AddClause("having", sql, parameters, joiner: "\nAND ", prefix: "HAVING ", postfix: "\n"); 166 | return this; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /Dapper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper", "Dapper\Dapper.csproj", "{DAF737E1-05B5-4189-A5AA-DAC6233B64D7}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests", "Tests\DapperTests.csproj", "{A2A80512-11F4-4028-A995-505463632C84}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper NET35", "Dapper NET35\Dapper NET35.csproj", "{B26305D8-3A89-4D68-A981-9BBF378B81FA}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib", "Dapper.Contrib\Dapper.Contrib.csproj", "{C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Contrib.Tests", "Dapper.Contrib.Tests\Dapper.Contrib.Tests.csproj", "{A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET35", "DapperTests NET35\DapperTests NET35.csproj", "{3BAA9F79-BA0A-4092-B47B-20170DD47989}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.SqlBuilder", "Dapper.SqlBuilder\Dapper.SqlBuilder.csproj", "{BF782EF1-2B0F-42FA-9DD0-928454A94C6D}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapper.Rainbow", "Dapper.Rainbow\Dapper.Rainbow.csproj", "{21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}" 19 | EndProject 20 | Global 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 22 | Debug|Any CPU = Debug|Any CPU 23 | Debug|Mixed Platforms = Debug|Mixed Platforms 24 | Debug|x86 = Debug|x86 25 | Release|Any CPU = Release|Any CPU 26 | Release|Mixed Platforms = Release|Mixed Platforms 27 | Release|x86 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 33 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 34 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Debug|x86.ActiveCfg = Debug|Any CPU 35 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Any CPU.Build.0 = Release|Any CPU 37 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 38 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU 39 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7}.Release|x86.ActiveCfg = Release|Any CPU 40 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|Any CPU.ActiveCfg = Debug|x86 41 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 42 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|Mixed Platforms.Build.0 = Debug|x86 43 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|x86.ActiveCfg = Debug|x86 44 | {A2A80512-11F4-4028-A995-505463632C84}.Debug|x86.Build.0 = Debug|x86 45 | {A2A80512-11F4-4028-A995-505463632C84}.Release|Any CPU.ActiveCfg = Release|x86 46 | {A2A80512-11F4-4028-A995-505463632C84}.Release|Mixed Platforms.ActiveCfg = Release|x86 47 | {A2A80512-11F4-4028-A995-505463632C84}.Release|Mixed Platforms.Build.0 = Release|x86 48 | {A2A80512-11F4-4028-A995-505463632C84}.Release|x86.ActiveCfg = Release|x86 49 | {A2A80512-11F4-4028-A995-505463632C84}.Release|x86.Build.0 = Release|x86 50 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 53 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 54 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Debug|x86.ActiveCfg = Debug|Any CPU 55 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Any CPU.ActiveCfg = Release|Any CPU 56 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Any CPU.Build.0 = Release|Any CPU 57 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 58 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|Mixed Platforms.Build.0 = Release|Any CPU 59 | {B26305D8-3A89-4D68-A981-9BBF378B81FA}.Release|x86.ActiveCfg = Release|Any CPU 60 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 61 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU 62 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 63 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 64 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Debug|x86.ActiveCfg = Debug|Any CPU 65 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU 66 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Any CPU.Build.0 = Release|Any CPU 67 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 68 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|Mixed Platforms.Build.0 = Release|Any CPU 69 | {C2FC4DF5-C8D1-4EA8-8E0C-85A3793EB0BB}.Release|x86.ActiveCfg = Release|Any CPU 70 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|Any CPU.ActiveCfg = Debug|x86 71 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 72 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|Mixed Platforms.Build.0 = Debug|x86 73 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|x86.ActiveCfg = Debug|x86 74 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Debug|x86.Build.0 = Debug|x86 75 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Any CPU.ActiveCfg = Release|x86 76 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Mixed Platforms.ActiveCfg = Release|x86 77 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|Mixed Platforms.Build.0 = Release|x86 78 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|x86.ActiveCfg = Release|x86 79 | {A4F4A06E-D179-4251-A232-AEF4CE9AD9B5}.Release|x86.Build.0 = Release|x86 80 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|Any CPU.ActiveCfg = Debug|x86 81 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 82 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|Mixed Platforms.Build.0 = Debug|x86 83 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|x86.ActiveCfg = Debug|x86 84 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Debug|x86.Build.0 = Debug|x86 85 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|Any CPU.ActiveCfg = Release|x86 86 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|Mixed Platforms.ActiveCfg = Release|x86 87 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|Mixed Platforms.Build.0 = Release|x86 88 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|x86.ActiveCfg = Release|x86 89 | {3BAA9F79-BA0A-4092-B47B-20170DD47989}.Release|x86.Build.0 = Release|x86 90 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 91 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU 92 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 93 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 94 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Debug|x86.ActiveCfg = Debug|Any CPU 95 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU 96 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Any CPU.Build.0 = Release|Any CPU 97 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 98 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|Mixed Platforms.Build.0 = Release|Any CPU 99 | {BF782EF1-2B0F-42FA-9DD0-928454A94C6D}.Release|x86.ActiveCfg = Release|Any CPU 100 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 101 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Debug|Any CPU.Build.0 = Debug|Any CPU 102 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 103 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 104 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Debug|x86.ActiveCfg = Debug|Any CPU 105 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Release|Any CPU.ActiveCfg = Release|Any CPU 106 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Release|Any CPU.Build.0 = Release|Any CPU 107 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 108 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Release|Mixed Platforms.Build.0 = Release|Any CPU 109 | {21BC6EA8-3D10-4CC9-A1B3-9FAD59F7D1BB}.Release|x86.ActiveCfg = Release|Any CPU 110 | EndGlobalSection 111 | GlobalSection(SolutionProperties) = preSolution 112 | HideSolutionNode = FALSE 113 | EndGlobalSection 114 | EndGlobal 115 | -------------------------------------------------------------------------------- /Dapper/Dapper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {DAF737E1-05B5-4189-A5AA-DAC6233B64D7} 9 | Library 10 | Properties 11 | Dapper 12 | Dapper 13 | v4.0 14 | 512 15 | Client 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | true 26 | bin\Debug\Dapper.xml 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | bin\Release\Dapper.xml 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Designer 50 | 51 | 52 | 53 | 60 | -------------------------------------------------------------------------------- /Dapper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("Dapper")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Stack Exchange")] 13 | [assembly: AssemblyProduct("Dapper")] 14 | [assembly: AssemblyCopyright("Copyright © Sam Saffron 2011")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: CLSCompliant(true)] 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("59080aa9-fa65-438f-ad2e-772d840effa9")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Build and Revision Numbers 34 | // by using the '*' as shown below: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.12.0.0")] 37 | [assembly: AssemblyFileVersion("1.12.0.0")] 38 | -------------------------------------------------------------------------------- /Dapper/dapper.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dapper 5 | 1.12.1 6 | Dapper dot net 7 | Sam Saffron,Marc Gravell 8 | Sam Saffron,Marc Gravell 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | http://code.google.com/p/dapper-dot-net/ 11 | false 12 | A high performance Micro-ORM supporting Sql Server, MySQL, Sqlite, SqlCE, Firebird etc.. 13 | A high performance Micro-ORM 14 | orm sql micro-orm 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | * 1.12.1 - Minor deploy glitch (should now include intellisense files!) 23 | * 1.12 - Better automatic type-mapping (int vs long, float vs double, etc) 24 | * Fixed: bug with indexer properties 25 | * 1.11 - Custom type-map support 26 | * 1.10 - Fixed: error-handling could lose original exception if reader closed 27 | * 1.9 - Added: better schema change detection 28 | * Fixed: enum support for T in Query-of-T 29 | * Added: dictionary support for parameters 30 | * 1.8 - Started release notes 31 | * Important: Dapper is now shipping as a DLL which will work on .net 3.5 or .net 4.0, 32 | * This improves the debugging experience as you no longer break into dapper when SQL fails. 33 | * Added: ParameterNames on DynamicParameters 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /DapperTests NET35/DapperTests NET35.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {3BAA9F79-BA0A-4092-B47B-20170DD47989} 9 | Exe 10 | Properties 11 | DapperTests_NET35 12 | DapperTests NET35 13 | v3.5 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | TRACE;DEBUG;NET35 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE;NET35 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Assert.cs 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | {B26305D8-3A89-4D68-A981-9BBF378B81FA} 57 | Dapper NET35 58 | 59 | 60 | 61 | 68 | -------------------------------------------------------------------------------- /DapperTests NET35/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Data.SqlClient; 4 | 5 | namespace DapperTests_NET35 6 | { 7 | class Program 8 | { 9 | static void Main() 10 | { 11 | RunTests(); 12 | Console.WriteLine("(end of tests; press any key)"); 13 | 14 | Console.ReadKey(); 15 | } 16 | public static readonly string connectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True"; 17 | 18 | public static SqlConnection GetOpenConnection() 19 | { 20 | var connection = new SqlConnection(connectionString); 21 | connection.Open(); 22 | return connection; 23 | } 24 | private static void RunTests() 25 | { 26 | var tester = new Tests(); 27 | foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) 28 | { 29 | Console.Write("Running " + method.Name); 30 | method.Invoke(tester, null); 31 | Console.WriteLine(" - OK!"); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DapperTests NET35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DapperTests NET35")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("DapperTests NET35")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cad8d6dd-b2be-441c-a287-c45ecc772065")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DapperTests NET35/Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using System.Linq; 3 | using Dapper; 4 | using SqlMapper; 5 | 6 | namespace DapperTests_NET35 7 | { 8 | public class Tests 9 | { 10 | SqlConnection connection = Program.GetOpenConnection(); 11 | 12 | public void TestBasicStringUsage() 13 | { 14 | var arr = connection.Query("select 'abc' as [Value] union all select @txt", new {txt = "def"}).ToArray(); 15 | arr.IsSequenceEqualTo(new[] { "abc", "def" }); 16 | } 17 | public void TestClassWithStringUsage() 18 | { 19 | var arr = connection.Query("select 'abc' as [Value] union all select @txt", new { txt = "def" }).ToArray(); 20 | arr.Select(x => x.Value).IsSequenceEqualTo(new[] { "abc", "def" }); 21 | } 22 | class BasicType 23 | { 24 | public string Value { get; set; } 25 | } 26 | 27 | public void TestDynamicSimulatedQuery() { 28 | var rows = connection.Query("select 1 A, 2 B union all select 3, 4", null).ToList(); 29 | 30 | ((int)rows[0]["A"]) 31 | .IsEqualTo(1); 32 | 33 | ((int)rows[0]["B"]) 34 | .IsEqualTo(2); 35 | 36 | ((int)rows[1]["A"]) 37 | .IsEqualTo(3); 38 | 39 | ((int)rows[1]["B"]) 40 | .IsEqualTo(4); 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DapperTests NET35/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DapperTests NET45/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DapperTests NET45/DapperTests NET45.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | {B7B69EE5-0E0D-4218-88DF-79E7D2355D26} 7 | Exe 8 | Properties 9 | DapperTests_NET45 10 | DapperTests NET45 11 | v4.5 12 | 512 13 | 14 | 15 | x86 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE;NET45 21 | prompt 22 | 4 23 | 24 | 25 | x86 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE;NET45 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Assert.cs 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | {EDD52209-45E8-42BA-81C1-D39FA1F07646} 53 | Dapper NET45 54 | 55 | 56 | 57 | 64 | -------------------------------------------------------------------------------- /DapperTests NET45/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.SqlClient; 3 | using System.Reflection; 4 | 5 | namespace DapperTests_NET45 6 | { 7 | class Program 8 | { 9 | static void Main() 10 | { 11 | RunTests(); 12 | Console.WriteLine("(end of tests; press any key)"); 13 | 14 | Console.ReadKey(); 15 | } 16 | public static readonly string connectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True"; 17 | 18 | public static SqlConnection GetOpenConnection() 19 | { 20 | var connection = new SqlConnection(connectionString); 21 | connection.Open(); 22 | return connection; 23 | } 24 | private static void RunTests() 25 | { 26 | var tester = new Tests(); 27 | foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) 28 | { 29 | Console.Write("Running " + method.Name); 30 | method.Invoke(tester, null); 31 | Console.WriteLine(" - OK!"); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DapperTests NET45/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DapperTests NET45")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("DapperTests NET45")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1f0b3016-b2c8-4ba8-b438-520b784e06a8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DapperTests NET45/Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Dapper; 3 | using SqlMapper; 4 | 5 | namespace DapperTests_NET45 6 | { 7 | public class Tests 8 | { 9 | public void TestBasicStringUsageAsync() 10 | { 11 | using (var connection = Program.GetOpenConnection()) 12 | { 13 | var query = connection.QueryAsync("select 'abc' as [Value] union all select @txt", new { txt = "def" }); 14 | var arr = query.Result.ToArray(); 15 | arr.IsSequenceEqualTo(new[] { "abc", "def" }); 16 | } 17 | } 18 | 19 | public void TestClassWithStringUsageAsync() 20 | { 21 | using (var connection = Program.GetOpenConnection()) 22 | { 23 | var query = connection.QueryAsync("select 'abc' as [Value] union all select @txt", new { txt = "def" }); 24 | var arr = query.Result.ToArray(); 25 | arr.Select(x => x.Value).IsSequenceEqualTo(new[] { "abc", "def" }); 26 | } 27 | } 28 | 29 | public void TestMultiMapWithSplitAsync() 30 | { 31 | var sql = @"select 1 as id, 'abc' as name, 2 as id, 'def' as name"; 32 | using (var connection = Program.GetOpenConnection()) 33 | { 34 | var productQuery = connection.QueryAsync(sql, (prod, cat) => 35 | { 36 | prod.Category = cat; 37 | return prod; 38 | }); 39 | 40 | var product = productQuery.Result.First(); 41 | // assertions 42 | product.Id.IsEqualTo(1); 43 | product.Name.IsEqualTo("abc"); 44 | product.Category.Id.IsEqualTo(2); 45 | product.Category.Name.IsEqualTo("def"); 46 | } 47 | } 48 | 49 | class Product 50 | { 51 | public int Id { get; set; } 52 | public string Name { get; set; } 53 | public Category Category { get; set; } 54 | } 55 | class Category 56 | { 57 | public int Id { get; set; } 58 | public string Name { get; set; } 59 | public string Description { get; set; } 60 | } 61 | 62 | class BasicType 63 | { 64 | public string Value { get; set; } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | http://www.apache.org/licenses/LICENSE-2.0 -------------------------------------------------------------------------------- /Packages.dgml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /Tests/Assert.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SqlMapper 7 | { 8 | static class Assert 9 | { 10 | 11 | public static void IsEqualTo(this T obj, T other) 12 | { 13 | if (!obj.Equals(other)) 14 | { 15 | throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other)); 16 | } 17 | } 18 | 19 | public static void IsSequenceEqualTo(this IEnumerable obj, IEnumerable other) 20 | { 21 | if (!obj.SequenceEqual(other)) 22 | { 23 | throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other)); 24 | } 25 | } 26 | 27 | public static void IsFalse(this bool b) 28 | { 29 | if (b) 30 | { 31 | throw new ApplicationException("Expected false"); 32 | } 33 | } 34 | 35 | public static void IsTrue(this bool b) 36 | { 37 | if (!b) 38 | { 39 | throw new ApplicationException("Expected true"); 40 | } 41 | } 42 | 43 | public static void IsNull(this object obj) 44 | { 45 | if (obj != null) 46 | { 47 | throw new ApplicationException("Expected null"); 48 | } 49 | } 50 | 51 | public static void IsNotNull(this object obj) 52 | { 53 | if (obj == null) 54 | { 55 | throw new ApplicationException("Expected not null"); 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Tests/EntityFramework/Model.edmx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Tests/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Stack Overflow Internet Services, Inc 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Tests/Linq2Sql/DataClasses.dbml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
-------------------------------------------------------------------------------- /Tests/Linq2Sql/DataClasses.dbml.layout: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Tests/Linq2Sql/Post.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace SqlMapper.Linq2Sql 3 | { 4 | public partial class Post 5 | { 6 | /* 7 | public int Bloat { get; set; } 8 | public int Bloat1 { get; set; } 9 | public int Bloat2 { get; set; } 10 | public int Bloat3 { get; set; } 11 | public int Bloat4 { get; set; } 12 | public int Bloat5 { get; set; } 13 | public int Bloat6 { get; set; } 14 | public int Bloat7 { get; set; } 15 | public int Bloat8 { get; set; } 16 | 17 | 18 | public int Bloat10 { get; set; } 19 | public int Bloat11 { get; set; } 20 | public int Bloat12 { get; set; } 21 | public int Bloat13 { get; set; } 22 | public int Bloat14 { get; set; } 23 | public int Bloat15 { get; set; } 24 | public int Bloat16 { get; set; } 25 | public int Bloat17 { get; set; } 26 | public int Bloat18 { get; set; } 27 | */ 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tests/NHibernate/Iesi.Collections.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/NHibernate/Iesi.Collections.dll -------------------------------------------------------------------------------- /Tests/NHibernate/LinFu.DynamicProxy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/NHibernate/LinFu.DynamicProxy.dll -------------------------------------------------------------------------------- /Tests/NHibernate/NHibernate.ByteCode.LinFu.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/NHibernate/NHibernate.ByteCode.LinFu.dll -------------------------------------------------------------------------------- /Tests/NHibernate/NHibernate.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/NHibernate/NHibernate.dll -------------------------------------------------------------------------------- /Tests/NHibernate/NHibernateHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using NHibernate; 3 | using NHibernate.Cfg; 4 | 5 | namespace SqlMapper.NHibernate 6 | { 7 | public class NHibernateHelper 8 | { 9 | private static ISessionFactory _sessionFactory; 10 | 11 | private static ISessionFactory SessionFactory 12 | { 13 | get 14 | { 15 | if (_sessionFactory == null) 16 | { 17 | var configuration = new Configuration(); 18 | configuration.Configure(@"..\..\NHibernate\hibernate.cfg.xml"); 19 | configuration.AddAssembly(typeof(Post).Assembly); 20 | configuration.AddXmlFile(@"..\..\NHibernate\Post.hbm.xml"); 21 | _sessionFactory = configuration.BuildSessionFactory(); 22 | } 23 | 24 | return _sessionFactory; 25 | } 26 | } 27 | 28 | public static IStatelessSession OpenSession() 29 | { 30 | return SessionFactory.OpenStatelessSession(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tests/NHibernate/Post.hbm.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Tests/NHibernate/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | NHibernate.Connection.DriverConnectionProvider 5 | NHibernate.Dialect.MsSql2005Dialect 6 | NHibernate.Driver.SqlClientDriver 7 | Smackdown.Properties.Settings.tempdbConnectionString 8 | NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu 9 | false 10 | false 11 | 12 | -------------------------------------------------------------------------------- /Tests/OrmLite/ServiceStack.Common.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/OrmLite/ServiceStack.Common.dll -------------------------------------------------------------------------------- /Tests/OrmLite/ServiceStack.Interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/OrmLite/ServiceStack.Interfaces.dll -------------------------------------------------------------------------------- /Tests/OrmLite/ServiceStack.OrmLite.SqlServer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/OrmLite/ServiceStack.OrmLite.SqlServer.dll -------------------------------------------------------------------------------- /Tests/OrmLite/ServiceStack.OrmLite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/OrmLite/ServiceStack.OrmLite.dll -------------------------------------------------------------------------------- /Tests/OrmLite/ServiceStack.Text.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/OrmLite/ServiceStack.Text.dll -------------------------------------------------------------------------------- /Tests/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.SqlClient; 3 | using System.Reflection; 4 | using System.Linq; 5 | namespace SqlMapper 6 | { 7 | [ServiceStack.DataAnnotations.Alias("Posts")] 8 | [Soma.Core.Table(Name = "Posts")] 9 | class Post 10 | { 11 | [Soma.Core.Id(Soma.Core.IdKind.Identity)] 12 | public int Id { get; set; } 13 | public string Text { get; set; } 14 | public DateTime CreationDate { get; set; } 15 | public DateTime LastChangeDate { get; set; } 16 | public int? Counter1 { get; set; } 17 | public int? Counter2 { get; set; } 18 | public int? Counter3 { get; set; } 19 | public int? Counter4 { get; set; } 20 | public int? Counter5 { get; set; } 21 | public int? Counter6 { get; set; } 22 | public int? Counter7 { get; set; } 23 | public int? Counter8 { get; set; } 24 | public int? Counter9 { get; set; } 25 | 26 | } 27 | 28 | class Program 29 | { 30 | 31 | public static readonly string connectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True"; 32 | 33 | public static SqlConnection GetOpenConnection() 34 | { 35 | var connection = new SqlConnection(connectionString); 36 | connection.Open(); 37 | return connection; 38 | } 39 | 40 | static void RunPerformanceTests() 41 | { 42 | var test = new PerformanceTests(); 43 | const int iterations = 500; 44 | Console.WriteLine("Running {0} iterations that load up a post entity", iterations); 45 | test.Run(iterations); 46 | } 47 | 48 | static void Main() 49 | { 50 | 51 | #if DEBUG 52 | RunTests(); 53 | #else 54 | EnsureDBSetup(); 55 | RunPerformanceTests(); 56 | #endif 57 | Console.WriteLine("(end of tests; press any key)"); 58 | 59 | Console.ReadKey(); 60 | } 61 | 62 | private static void EnsureDBSetup() 63 | { 64 | using (var cnn = GetOpenConnection()) 65 | { 66 | var cmd = cnn.CreateCommand(); 67 | cmd.CommandText = @" 68 | if (OBJECT_ID('Posts') is null) 69 | begin 70 | create table Posts 71 | ( 72 | Id int identity primary key, 73 | [Text] varchar(max) not null, 74 | CreationDate datetime not null, 75 | LastChangeDate datetime not null, 76 | Counter1 int, 77 | Counter2 int, 78 | Counter3 int, 79 | Counter4 int, 80 | Counter5 int, 81 | Counter6 int, 82 | Counter7 int, 83 | Counter8 int, 84 | Counter9 int 85 | ) 86 | 87 | set nocount on 88 | 89 | declare @i int 90 | declare @c int 91 | 92 | declare @id int 93 | 94 | set @i = 0 95 | 96 | while @i <= 5001 97 | begin 98 | 99 | insert Posts ([Text],CreationDate, LastChangeDate) values (replicate('x', 2000), GETDATE(), GETDATE()) 100 | set @id = @@IDENTITY 101 | 102 | set @i = @i + 1 103 | end 104 | end 105 | "; 106 | cmd.Connection = cnn; 107 | cmd.ExecuteNonQuery(); 108 | } 109 | } 110 | 111 | private static void RunTests() 112 | { 113 | var tester = new Tests(); 114 | int fail = 0; 115 | MethodInfo[] methods = typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly); 116 | var activeTests = methods.Where(m => Attribute.IsDefined(m, typeof(ActiveTestAttribute))).ToArray(); 117 | if (activeTests.Length != 0) methods = activeTests; 118 | foreach (var method in methods) 119 | { 120 | Console.Write("Running " + method.Name); 121 | try 122 | { 123 | method.Invoke(tester, null); 124 | Console.WriteLine(" - OK!"); 125 | } catch(TargetInvocationException tie) 126 | { 127 | fail++; 128 | Console.WriteLine(" - " + tie.InnerException.Message); 129 | 130 | }catch (Exception ex) 131 | { 132 | fail++; 133 | Console.WriteLine(" - " + ex.Message); 134 | } 135 | } 136 | Console.WriteLine(); 137 | if(fail == 0) 138 | { 139 | Console.WriteLine("(all tests successful)"); 140 | } 141 | else 142 | { 143 | Console.WriteLine("#### FAILED: {0}", fail); 144 | } 145 | } 146 | } 147 | 148 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 149 | public sealed class ActiveTestAttribute : Attribute {} 150 | 151 | } 152 | -------------------------------------------------------------------------------- /Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Smackdown")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Smackdown")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("77246f63-77a4-4d9f-a4d6-62282d67c8be")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Tests/Properties/DataSources/SqlMapper.EntityFramework.tempdbEntities1.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | SqlMapper.EntityFramework.tempdbEntities1, EntityFramework.Model.Designer.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /Tests/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.225 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SqlMapper.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] 29 | [global::System.Configuration.DefaultSettingValueAttribute("Data Source=.;Initial Catalog=tempdb;Integrated Security=True")] 30 | public string tempdbConnectionString { 31 | get { 32 | return ((string)(this["tempdbConnectionString"])); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Tests/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | <?xml version="1.0" encoding="utf-16"?> 7 | <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 8 | <ConnectionString>Data Source=.;Initial Catalog=tempdb;Integrated Security=True</ConnectionString> 9 | <ProviderName>System.Data.SqlClient</ProviderName> 10 | </SerializableConnectionString> 11 | Data Source=.;Initial Catalog=tempdb;Integrated Security=True 12 | 13 | 14 | -------------------------------------------------------------------------------- /Tests/Simple.Data/Simple.Data.Ado.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/Simple.Data/Simple.Data.Ado.dll -------------------------------------------------------------------------------- /Tests/Simple.Data/Simple.Data.SqlServer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/Simple.Data/Simple.Data.SqlServer.dll -------------------------------------------------------------------------------- /Tests/Simple.Data/Simple.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/Simple.Data/Simple.Data.dll -------------------------------------------------------------------------------- /Tests/Soma/Soma.Core.IT.MsSql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/Soma/Soma.Core.IT.MsSql.dll -------------------------------------------------------------------------------- /Tests/Soma/Soma.Core.IT.MsSqlCe.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/Soma/Soma.Core.IT.MsSqlCe.dll -------------------------------------------------------------------------------- /Tests/Soma/Soma.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/Soma/Soma.Core.dll -------------------------------------------------------------------------------- /Tests/SubSonic/Context.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | using System; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Linq.Expressions; 8 | using SubSonic.DataProviders; 9 | using SubSonic.Extensions; 10 | using SubSonic.Linq.Structure; 11 | using SubSonic.Query; 12 | using SubSonic.Schema; 13 | using System.Data.Common; 14 | using System.Collections.Generic; 15 | 16 | namespace SubSonic 17 | { 18 | public partial class tempdbDB : IQuerySurface 19 | { 20 | 21 | public IDataProvider DataProvider; 22 | public DbQueryProvider provider; 23 | 24 | public static IDataProvider DefaultDataProvider { get; set; } 25 | 26 | public bool TestMode 27 | { 28 | get 29 | { 30 | return DataProvider.ConnectionString.Equals("test", StringComparison.InvariantCultureIgnoreCase); 31 | } 32 | } 33 | 34 | public tempdbDB() 35 | { 36 | if (DefaultDataProvider == null) { 37 | DataProvider = ProviderFactory.GetProvider("Smackdown.Properties.Settings.tempdbConnectionString"); 38 | } 39 | else { 40 | DataProvider = DefaultDataProvider; 41 | } 42 | Init(); 43 | } 44 | 45 | public tempdbDB(string connectionStringName) 46 | { 47 | DataProvider = ProviderFactory.GetProvider(connectionStringName); 48 | Init(); 49 | } 50 | 51 | public tempdbDB(string connectionString, string providerName) 52 | { 53 | DataProvider = ProviderFactory.GetProvider(connectionString,providerName); 54 | Init(); 55 | } 56 | 57 | public ITable FindByPrimaryKey(string pkName) 58 | { 59 | return DataProvider.Schema.Tables.SingleOrDefault(x => x.PrimaryKey.Name.Equals(pkName, StringComparison.InvariantCultureIgnoreCase)); 60 | } 61 | 62 | public Query GetQuery() 63 | { 64 | return new Query(provider); 65 | } 66 | 67 | public ITable FindTable(string tableName) 68 | { 69 | return DataProvider.FindTable(tableName); 70 | } 71 | 72 | public IDataProvider Provider 73 | { 74 | get { return DataProvider; } 75 | set {DataProvider=value;} 76 | } 77 | 78 | public DbQueryProvider QueryProvider 79 | { 80 | get { return provider; } 81 | } 82 | 83 | BatchQuery _batch = null; 84 | public void Queue(IQueryable qry) 85 | { 86 | if (_batch == null) 87 | _batch = new BatchQuery(Provider, QueryProvider); 88 | _batch.Queue(qry); 89 | } 90 | 91 | public void Queue(ISqlQuery qry) 92 | { 93 | if (_batch == null) 94 | _batch = new BatchQuery(Provider, QueryProvider); 95 | _batch.Queue(qry); 96 | } 97 | 98 | public void ExecuteTransaction(IList commands) 99 | { 100 | if(!TestMode) 101 | { 102 | using(var connection = commands[0].Connection) 103 | { 104 | if (connection.State == ConnectionState.Closed) 105 | connection.Open(); 106 | 107 | using (var trans = connection.BeginTransaction()) 108 | { 109 | foreach (var cmd in commands) 110 | { 111 | cmd.Transaction = trans; 112 | cmd.Connection = connection; 113 | cmd.ExecuteNonQuery(); 114 | } 115 | trans.Commit(); 116 | } 117 | connection.Close(); 118 | } 119 | } 120 | } 121 | 122 | public IDataReader ExecuteBatch() 123 | { 124 | if (_batch == null) 125 | throw new InvalidOperationException("There's nothing in the queue"); 126 | if(!TestMode) 127 | return _batch.ExecuteReader(); 128 | return null; 129 | } 130 | 131 | public Query Posts { get; set; } 132 | 133 | 134 | 135 | #region ' Aggregates and SubSonic Queries ' 136 | public Select SelectColumns(params string[] columns) 137 | { 138 | return new Select(DataProvider, columns); 139 | } 140 | 141 | public Select Select 142 | { 143 | get { return new Select(this.Provider); } 144 | } 145 | 146 | public Insert Insert 147 | { 148 | get { return new Insert(this.Provider); } 149 | } 150 | 151 | public Update Update() where T:new() 152 | { 153 | return new Update(this.Provider); 154 | } 155 | 156 | public SqlQuery Delete(Expression> column) where T:new() 157 | { 158 | LambdaExpression lamda = column; 159 | SqlQuery result = new Delete(this.Provider); 160 | result = result.From(); 161 | result.Constraints=lamda.ParseConstraints().ToList(); 162 | return result; 163 | } 164 | 165 | public SqlQuery Max(Expression> column) 166 | { 167 | LambdaExpression lamda = column; 168 | string colName = lamda.ParseObjectValue(); 169 | string objectName = typeof(T).Name; 170 | string tableName = DataProvider.FindTable(objectName).Name; 171 | return new Select(DataProvider, new Aggregate(colName, AggregateFunction.Max)).From(tableName); 172 | } 173 | 174 | public SqlQuery Min(Expression> column) 175 | { 176 | LambdaExpression lamda = column; 177 | string colName = lamda.ParseObjectValue(); 178 | string objectName = typeof(T).Name; 179 | string tableName = this.Provider.FindTable(objectName).Name; 180 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Min)).From(tableName); 181 | } 182 | 183 | public SqlQuery Sum(Expression> column) 184 | { 185 | LambdaExpression lamda = column; 186 | string colName = lamda.ParseObjectValue(); 187 | string objectName = typeof(T).Name; 188 | string tableName = this.Provider.FindTable(objectName).Name; 189 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Sum)).From(tableName); 190 | } 191 | 192 | public SqlQuery Avg(Expression> column) 193 | { 194 | LambdaExpression lamda = column; 195 | string colName = lamda.ParseObjectValue(); 196 | string objectName = typeof(T).Name; 197 | string tableName = this.Provider.FindTable(objectName).Name; 198 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Avg)).From(tableName); 199 | } 200 | 201 | public SqlQuery Count(Expression> column) 202 | { 203 | LambdaExpression lamda = column; 204 | string colName = lamda.ParseObjectValue(); 205 | string objectName = typeof(T).Name; 206 | string tableName = this.Provider.FindTable(objectName).Name; 207 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Count)).From(tableName); 208 | } 209 | 210 | public SqlQuery Variance(Expression> column) 211 | { 212 | LambdaExpression lamda = column; 213 | string colName = lamda.ParseObjectValue(); 214 | string objectName = typeof(T).Name; 215 | string tableName = this.Provider.FindTable(objectName).Name; 216 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Var)).From(tableName); 217 | } 218 | 219 | public SqlQuery StandardDeviation(Expression> column) 220 | { 221 | LambdaExpression lamda = column; 222 | string colName = lamda.ParseObjectValue(); 223 | string objectName = typeof(T).Name; 224 | string tableName = this.Provider.FindTable(objectName).Name; 225 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.StDev)).From(tableName); 226 | } 227 | 228 | #endregion 229 | 230 | void Init() 231 | { 232 | provider = new DbQueryProvider(this.Provider); 233 | 234 | #region ' Query Defs ' 235 | Posts = new Query(provider); 236 | #endregion 237 | 238 | 239 | #region ' Schemas ' 240 | if(DataProvider.Schema.Tables.Count == 0) 241 | { 242 | DataProvider.Schema.Tables.Add(new PostsTable(DataProvider)); 243 | } 244 | #endregion 245 | } 246 | 247 | 248 | #region ' Helpers ' 249 | 250 | internal static DateTime DateTimeNowTruncatedDownToSecond() { 251 | var now = DateTime.Now; 252 | return now.AddTicks(-now.Ticks % TimeSpan.TicksPerSecond); 253 | } 254 | 255 | #endregion 256 | 257 | } 258 | } -------------------------------------------------------------------------------- /Tests/SubSonic/Context.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#v3.5" debug="False" hostspecific="True" #> 2 | <#@ output extension=".cs" #> 3 | <#@ include file="SQLServer.ttinclude" #> 4 | <# 5 | var tables = LoadTables(); 6 | #> 7 | using System; 8 | using System.Data; 9 | using System.Linq; 10 | using System.Linq.Expressions; 11 | using SubSonic.DataProviders; 12 | using SubSonic.Extensions; 13 | using SubSonic.Linq.Structure; 14 | using SubSonic.Query; 15 | using SubSonic.Schema; 16 | using System.Data.Common; 17 | using System.Collections.Generic; 18 | 19 | namespace <#=Namespace#> 20 | { 21 | public partial class <#=DatabaseName#>DB : IQuerySurface 22 | { 23 | 24 | public IDataProvider DataProvider; 25 | public DbQueryProvider provider; 26 | 27 | public static IDataProvider DefaultDataProvider { get; set; } 28 | 29 | public bool TestMode 30 | { 31 | get 32 | { 33 | return DataProvider.ConnectionString.Equals("test", StringComparison.InvariantCultureIgnoreCase); 34 | } 35 | } 36 | 37 | public <#=DatabaseName#>DB() 38 | { 39 | if (DefaultDataProvider == null) { 40 | DataProvider = ProviderFactory.GetProvider("<#=ConnectionStringName#>"); 41 | } 42 | else { 43 | DataProvider = DefaultDataProvider; 44 | } 45 | Init(); 46 | } 47 | 48 | public <#=DatabaseName#>DB(string connectionStringName) 49 | { 50 | DataProvider = ProviderFactory.GetProvider(connectionStringName); 51 | Init(); 52 | } 53 | 54 | public <#=DatabaseName#>DB(string connectionString, string providerName) 55 | { 56 | DataProvider = ProviderFactory.GetProvider(connectionString,providerName); 57 | Init(); 58 | } 59 | 60 | public ITable FindByPrimaryKey(string pkName) 61 | { 62 | return DataProvider.Schema.Tables.SingleOrDefault(x => x.PrimaryKey.Name.Equals(pkName, StringComparison.InvariantCultureIgnoreCase)); 63 | } 64 | 65 | public Query GetQuery() 66 | { 67 | return new Query(provider); 68 | } 69 | 70 | public ITable FindTable(string tableName) 71 | { 72 | return DataProvider.FindTable(tableName); 73 | } 74 | 75 | public IDataProvider Provider 76 | { 77 | get { return DataProvider; } 78 | set {DataProvider=value;} 79 | } 80 | 81 | public DbQueryProvider QueryProvider 82 | { 83 | get { return provider; } 84 | } 85 | 86 | BatchQuery _batch = null; 87 | public void Queue(IQueryable qry) 88 | { 89 | if (_batch == null) 90 | _batch = new BatchQuery(Provider, QueryProvider); 91 | _batch.Queue(qry); 92 | } 93 | 94 | public void Queue(ISqlQuery qry) 95 | { 96 | if (_batch == null) 97 | _batch = new BatchQuery(Provider, QueryProvider); 98 | _batch.Queue(qry); 99 | } 100 | 101 | public void ExecuteTransaction(IList commands) 102 | { 103 | if(!TestMode) 104 | { 105 | using(var connection = commands[0].Connection) 106 | { 107 | if (connection.State == ConnectionState.Closed) 108 | connection.Open(); 109 | 110 | using (var trans = connection.BeginTransaction()) 111 | { 112 | foreach (var cmd in commands) 113 | { 114 | cmd.Transaction = trans; 115 | cmd.Connection = connection; 116 | cmd.ExecuteNonQuery(); 117 | } 118 | trans.Commit(); 119 | } 120 | connection.Close(); 121 | } 122 | } 123 | } 124 | 125 | public IDataReader ExecuteBatch() 126 | { 127 | if (_batch == null) 128 | throw new InvalidOperationException("There's nothing in the queue"); 129 | if(!TestMode) 130 | return _batch.ExecuteReader(); 131 | return null; 132 | } 133 | <# //################################################ IQueryable ####################################### #> 134 | <# foreach(Table tbl in tables){ 135 | if(!ExcludeTables.Contains(tbl.Name)) 136 | { 137 | #> 138 | public Query<<#=tbl.ClassName#>> <#=tbl.QueryableName#> { get; set; } 139 | <# 140 | } 141 | } 142 | #> 143 | 144 | <# //################################################ Aggregates and Queries ####################################### #> 145 | 146 | #region ' Aggregates and SubSonic Queries ' 147 | public Select SelectColumns(params string[] columns) 148 | { 149 | return new Select(DataProvider, columns); 150 | } 151 | 152 | public Select Select 153 | { 154 | get { return new Select(this.Provider); } 155 | } 156 | 157 | public Insert Insert 158 | { 159 | get { return new Insert(this.Provider); } 160 | } 161 | 162 | public Update Update() where T:new() 163 | { 164 | return new Update(this.Provider); 165 | } 166 | 167 | public SqlQuery Delete(Expression> column) where T:new() 168 | { 169 | LambdaExpression lamda = column; 170 | SqlQuery result = new Delete(this.Provider); 171 | result = result.From(); 172 | result.Constraints=lamda.ParseConstraints().ToList(); 173 | return result; 174 | } 175 | 176 | public SqlQuery Max(Expression> column) 177 | { 178 | LambdaExpression lamda = column; 179 | string colName = lamda.ParseObjectValue(); 180 | string objectName = typeof(T).Name; 181 | string tableName = DataProvider.FindTable(objectName).Name; 182 | return new Select(DataProvider, new Aggregate(colName, AggregateFunction.Max)).From(tableName); 183 | } 184 | 185 | public SqlQuery Min(Expression> column) 186 | { 187 | LambdaExpression lamda = column; 188 | string colName = lamda.ParseObjectValue(); 189 | string objectName = typeof(T).Name; 190 | string tableName = this.Provider.FindTable(objectName).Name; 191 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Min)).From(tableName); 192 | } 193 | 194 | public SqlQuery Sum(Expression> column) 195 | { 196 | LambdaExpression lamda = column; 197 | string colName = lamda.ParseObjectValue(); 198 | string objectName = typeof(T).Name; 199 | string tableName = this.Provider.FindTable(objectName).Name; 200 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Sum)).From(tableName); 201 | } 202 | 203 | public SqlQuery Avg(Expression> column) 204 | { 205 | LambdaExpression lamda = column; 206 | string colName = lamda.ParseObjectValue(); 207 | string objectName = typeof(T).Name; 208 | string tableName = this.Provider.FindTable(objectName).Name; 209 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Avg)).From(tableName); 210 | } 211 | 212 | public SqlQuery Count(Expression> column) 213 | { 214 | LambdaExpression lamda = column; 215 | string colName = lamda.ParseObjectValue(); 216 | string objectName = typeof(T).Name; 217 | string tableName = this.Provider.FindTable(objectName).Name; 218 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Count)).From(tableName); 219 | } 220 | 221 | public SqlQuery Variance(Expression> column) 222 | { 223 | LambdaExpression lamda = column; 224 | string colName = lamda.ParseObjectValue(); 225 | string objectName = typeof(T).Name; 226 | string tableName = this.Provider.FindTable(objectName).Name; 227 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.Var)).From(tableName); 228 | } 229 | 230 | public SqlQuery StandardDeviation(Expression> column) 231 | { 232 | LambdaExpression lamda = column; 233 | string colName = lamda.ParseObjectValue(); 234 | string objectName = typeof(T).Name; 235 | string tableName = this.Provider.FindTable(objectName).Name; 236 | return new Select(this.Provider, new Aggregate(colName, AggregateFunction.StDev)).From(tableName); 237 | } 238 | 239 | #endregion 240 | 241 | void Init() 242 | { 243 | provider = new DbQueryProvider(this.Provider); 244 | 245 | <# 246 | //################################################ QUERIES ####################################### #> 247 | #region ' Query Defs ' 248 | <# 249 | foreach(Table tbl in tables) 250 | { 251 | if(!ExcludeTables.Contains(tbl.Name)) 252 | { 253 | #> 254 | <#=tbl.QueryableName#> = new Query<<#=tbl.ClassName#>>(provider); 255 | <# 256 | } 257 | #> 258 | <# 259 | } 260 | #> 261 | #endregion 262 | 263 | <#//################################################ SCHEMAS ####################################### #> 264 | 265 | #region ' Schemas ' 266 | if(DataProvider.Schema.Tables.Count == 0) 267 | { 268 | <# 269 | foreach(Table tbl in tables) 270 | { 271 | if(!ExcludeTables.Contains(tbl.Name)) 272 | { 273 | #> 274 | DataProvider.Schema.Tables.Add(new <#=tbl.CleanName#>Table(DataProvider)); 275 | <# 276 | } 277 | } 278 | #> 279 | } 280 | #endregion 281 | } 282 | 283 | <#//################################################ HELPERS ####################################### #> 284 | 285 | #region ' Helpers ' 286 | 287 | internal static DateTime DateTimeNowTruncatedDownToSecond() { 288 | var now = DateTime.Now; 289 | return now.AddTicks(-now.Ticks % TimeSpan.TicksPerSecond); 290 | } 291 | 292 | #endregion 293 | 294 | } 295 | } -------------------------------------------------------------------------------- /Tests/SubSonic/StoredProcedures.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Tests/SubSonic/StoredProcedures.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#v3.5" debug="False" hostspecific="True" #> 2 | <#@ output extension=".cs" #> 3 | <#@ include file="SQLServer.ttinclude" #> 4 | <# 5 | var sps = GetSPs(); 6 | if(sps.Count>0){ 7 | #> 8 | using System; 9 | using SubSonic; 10 | using SubSonic.Schema; 11 | using SubSonic.DataProviders; 12 | using System.Data; 13 | 14 | namespace <#=Namespace#>{ 15 | public partial class <#=DatabaseName#>DB{ 16 | 17 | <# foreach(var sp in sps){#> 18 | public StoredProcedure <#=sp.CleanName#>(<#=sp.ArgList#>){ 19 | StoredProcedure sp=new StoredProcedure("<#=sp.Name#>",this.Provider); 20 | <# foreach(var par in sp.Parameters){#> 21 | sp.Command.AddParameter("<#=par.Name#>",<#=par.CleanName#>,DbType.<#=par.DbType#>); 22 | <# }#> 23 | return sp; 24 | } 25 | <# }#> 26 | 27 | } 28 | 29 | } 30 | <# }#> -------------------------------------------------------------------------------- /Tests/SubSonic/Structs.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | using System; 5 | using SubSonic.Schema; 6 | using System.Collections.Generic; 7 | using SubSonic.DataProviders; 8 | using System.Data; 9 | 10 | namespace SubSonic { 11 | 12 | /// 13 | /// Table: Posts 14 | /// Primary Key: Id 15 | /// 16 | 17 | public class PostsTable: DatabaseTable { 18 | 19 | public PostsTable(IDataProvider provider):base("Posts",provider){ 20 | ClassName = "Post"; 21 | SchemaName = "dbo"; 22 | 23 | 24 | Columns.Add(new DatabaseColumn("Id", this) 25 | { 26 | IsPrimaryKey = true, 27 | DataType = DbType.Int32, 28 | IsNullable = false, 29 | AutoIncrement = true, 30 | IsForeignKey = false, 31 | MaxLength = 0 32 | }); 33 | 34 | Columns.Add(new DatabaseColumn("Text", this) 35 | { 36 | IsPrimaryKey = false, 37 | DataType = DbType.AnsiString, 38 | IsNullable = false, 39 | AutoIncrement = false, 40 | IsForeignKey = false, 41 | MaxLength = -1 42 | }); 43 | 44 | Columns.Add(new DatabaseColumn("CreationDate", this) 45 | { 46 | IsPrimaryKey = false, 47 | DataType = DbType.DateTime, 48 | IsNullable = false, 49 | AutoIncrement = false, 50 | IsForeignKey = false, 51 | MaxLength = 0 52 | }); 53 | 54 | Columns.Add(new DatabaseColumn("LastChangeDate", this) 55 | { 56 | IsPrimaryKey = false, 57 | DataType = DbType.DateTime, 58 | IsNullable = false, 59 | AutoIncrement = false, 60 | IsForeignKey = false, 61 | MaxLength = 0 62 | }); 63 | 64 | Columns.Add(new DatabaseColumn("Counter1", this) 65 | { 66 | IsPrimaryKey = false, 67 | DataType = DbType.Int32, 68 | IsNullable = true, 69 | AutoIncrement = false, 70 | IsForeignKey = false, 71 | MaxLength = 0 72 | }); 73 | 74 | Columns.Add(new DatabaseColumn("Counter2", this) 75 | { 76 | IsPrimaryKey = false, 77 | DataType = DbType.Int32, 78 | IsNullable = true, 79 | AutoIncrement = false, 80 | IsForeignKey = false, 81 | MaxLength = 0 82 | }); 83 | 84 | Columns.Add(new DatabaseColumn("Counter3", this) 85 | { 86 | IsPrimaryKey = false, 87 | DataType = DbType.Int32, 88 | IsNullable = true, 89 | AutoIncrement = false, 90 | IsForeignKey = false, 91 | MaxLength = 0 92 | }); 93 | 94 | Columns.Add(new DatabaseColumn("Counter4", this) 95 | { 96 | IsPrimaryKey = false, 97 | DataType = DbType.Int32, 98 | IsNullable = true, 99 | AutoIncrement = false, 100 | IsForeignKey = false, 101 | MaxLength = 0 102 | }); 103 | 104 | Columns.Add(new DatabaseColumn("Counter5", this) 105 | { 106 | IsPrimaryKey = false, 107 | DataType = DbType.Int32, 108 | IsNullable = true, 109 | AutoIncrement = false, 110 | IsForeignKey = false, 111 | MaxLength = 0 112 | }); 113 | 114 | Columns.Add(new DatabaseColumn("Counter6", this) 115 | { 116 | IsPrimaryKey = false, 117 | DataType = DbType.Int32, 118 | IsNullable = true, 119 | AutoIncrement = false, 120 | IsForeignKey = false, 121 | MaxLength = 0 122 | }); 123 | 124 | Columns.Add(new DatabaseColumn("Counter7", this) 125 | { 126 | IsPrimaryKey = false, 127 | DataType = DbType.Int32, 128 | IsNullable = true, 129 | AutoIncrement = false, 130 | IsForeignKey = false, 131 | MaxLength = 0 132 | }); 133 | 134 | Columns.Add(new DatabaseColumn("Counter8", this) 135 | { 136 | IsPrimaryKey = false, 137 | DataType = DbType.Int32, 138 | IsNullable = true, 139 | AutoIncrement = false, 140 | IsForeignKey = false, 141 | MaxLength = 0 142 | }); 143 | 144 | Columns.Add(new DatabaseColumn("Counter9", this) 145 | { 146 | IsPrimaryKey = false, 147 | DataType = DbType.Int32, 148 | IsNullable = true, 149 | AutoIncrement = false, 150 | IsForeignKey = false, 151 | MaxLength = 0 152 | }); 153 | 154 | 155 | 156 | } 157 | 158 | public IColumn Id{ 159 | get{ 160 | return this.GetColumn("Id"); 161 | } 162 | } 163 | 164 | public static string IdColumn{ 165 | get{ 166 | return "Id"; 167 | } 168 | } 169 | 170 | public IColumn Text{ 171 | get{ 172 | return this.GetColumn("Text"); 173 | } 174 | } 175 | 176 | public static string TextColumn{ 177 | get{ 178 | return "Text"; 179 | } 180 | } 181 | 182 | public IColumn CreationDate{ 183 | get{ 184 | return this.GetColumn("CreationDate"); 185 | } 186 | } 187 | 188 | public static string CreationDateColumn{ 189 | get{ 190 | return "CreationDate"; 191 | } 192 | } 193 | 194 | public IColumn LastChangeDate{ 195 | get{ 196 | return this.GetColumn("LastChangeDate"); 197 | } 198 | } 199 | 200 | public static string LastChangeDateColumn{ 201 | get{ 202 | return "LastChangeDate"; 203 | } 204 | } 205 | 206 | public IColumn Counter1{ 207 | get{ 208 | return this.GetColumn("Counter1"); 209 | } 210 | } 211 | 212 | public static string Counter1Column{ 213 | get{ 214 | return "Counter1"; 215 | } 216 | } 217 | 218 | public IColumn Counter2{ 219 | get{ 220 | return this.GetColumn("Counter2"); 221 | } 222 | } 223 | 224 | public static string Counter2Column{ 225 | get{ 226 | return "Counter2"; 227 | } 228 | } 229 | 230 | public IColumn Counter3{ 231 | get{ 232 | return this.GetColumn("Counter3"); 233 | } 234 | } 235 | 236 | public static string Counter3Column{ 237 | get{ 238 | return "Counter3"; 239 | } 240 | } 241 | 242 | public IColumn Counter4{ 243 | get{ 244 | return this.GetColumn("Counter4"); 245 | } 246 | } 247 | 248 | public static string Counter4Column{ 249 | get{ 250 | return "Counter4"; 251 | } 252 | } 253 | 254 | public IColumn Counter5{ 255 | get{ 256 | return this.GetColumn("Counter5"); 257 | } 258 | } 259 | 260 | public static string Counter5Column{ 261 | get{ 262 | return "Counter5"; 263 | } 264 | } 265 | 266 | public IColumn Counter6{ 267 | get{ 268 | return this.GetColumn("Counter6"); 269 | } 270 | } 271 | 272 | public static string Counter6Column{ 273 | get{ 274 | return "Counter6"; 275 | } 276 | } 277 | 278 | public IColumn Counter7{ 279 | get{ 280 | return this.GetColumn("Counter7"); 281 | } 282 | } 283 | 284 | public static string Counter7Column{ 285 | get{ 286 | return "Counter7"; 287 | } 288 | } 289 | 290 | public IColumn Counter8{ 291 | get{ 292 | return this.GetColumn("Counter8"); 293 | } 294 | } 295 | 296 | public static string Counter8Column{ 297 | get{ 298 | return "Counter8"; 299 | } 300 | } 301 | 302 | public IColumn Counter9{ 303 | get{ 304 | return this.GetColumn("Counter9"); 305 | } 306 | } 307 | 308 | public static string Counter9Column{ 309 | get{ 310 | return "Counter9"; 311 | } 312 | } 313 | 314 | 315 | } 316 | 317 | } -------------------------------------------------------------------------------- /Tests/SubSonic/Structs.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#v3.5" debug="False" hostspecific="True" #> 2 | <#@ output extension=".cs" #> 3 | <#@ include file="SQLServer.ttinclude" #> 4 | <# 5 | var tables = LoadTables(); 6 | #> 7 | using System; 8 | using SubSonic.Schema; 9 | using System.Collections.Generic; 10 | using SubSonic.DataProviders; 11 | using System.Data; 12 | 13 | namespace <#=Namespace#> { 14 | 15 | <# foreach(var tbl in tables){ 16 | if(!ExcludeTables.Contains(tbl.Name)) 17 | { 18 | #> 19 | /// 20 | /// Table: <#=tbl.Name#> 21 | /// Primary Key: <#=tbl.PrimaryKey#> 22 | /// 23 | 24 | public class <#=tbl.CleanName#>Table: DatabaseTable { 25 | 26 | public <#=tbl.CleanName#>Table(IDataProvider provider):base("<#=tbl.Name#>",provider){ 27 | ClassName = "<#=tbl.ClassName#>"; 28 | SchemaName = "<#=tbl.Schema ?? ""#>"; 29 | 30 | <# foreach(var col in tbl.Columns){#> 31 | 32 | Columns.Add(new DatabaseColumn("<#=col.Name#>", this) 33 | { 34 | IsPrimaryKey = <#=col.IsPK.ToString().ToLower()#>, 35 | DataType = DbType.<#=col.DbType.ToString()#>, 36 | IsNullable = <#=col.IsNullable.ToString().ToLower()#>, 37 | AutoIncrement = <#=col.AutoIncrement.ToString().ToLower()#>, 38 | IsForeignKey = <#=col.IsForeignKey.ToString().ToLower()#>, 39 | MaxLength = <#=col.MaxLength#> 40 | }); 41 | <# }#> 42 | 43 | 44 | } 45 | 46 | <# foreach(var col in tbl.Columns){#> 47 | public IColumn <#=col.CleanName#>{ 48 | get{ 49 | return this.GetColumn("<#=col.Name#>"); 50 | } 51 | } 52 | 53 | public static string <#= col.CleanName #>Column{ 54 | get{ 55 | return "<#= col.Name #>"; 56 | } 57 | } 58 | 59 | <# }#> 60 | } 61 | 62 | <# 63 | } 64 | 65 | } 66 | #> 67 | } -------------------------------------------------------------------------------- /Tests/SubSonic/SubSonic.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/SubSonic/SubSonic.Core.dll -------------------------------------------------------------------------------- /Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Tests/bltoolkit/BLToolkit.4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/Tests/bltoolkit/BLToolkit.4.dll -------------------------------------------------------------------------------- /Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Content/FSPowerPack_Example.fs.pp: -------------------------------------------------------------------------------- 1 | module FSPowerPowerExample 2 | 3 | open System 4 | 5 | let v = vector [1.0;1.0;1.0] + vector [2.0;2.0;2.0] // (3.0; 3.0; 3.0) 6 | let c = complex 0.0 1.0 * complex 0.0 1.0 // -1r+0i 7 | let r = (1N/2N) * (1N/3N) // 1/6 -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/FSPowerPack.Community.2.0.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/FSPowerPack.Community.2.0.0.0.nupkg -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.Linq.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.Linq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.PowerPack.Linq 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Convert the quotation expression to LINQ expression trees 59 | 60 | This operation will only succeed for a subset of quotation expressions. 61 | 62 | Exceptions: InvalidArgumentException will be raised if the input expression is 63 | not in the subset that can be converted to a LINQ expression tree 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Compile the quotation expression by first converting to LINQ expression trees 72 | 73 | Exceptions: InvalidArgumentException will be raised if the input expression is 74 | not in the subset that can be converted to a LINQ expression tree 75 | 76 | 77 | 78 | 79 | Evaluate the quotation expression by first converting to LINQ expression trees 80 | 81 | Exceptions: InvalidArgumentException will be raised if the input expression is 82 | not in the subset that can be converted to a LINQ expression tree 83 | 84 | 85 | 86 | 87 | Compile the quotation expression by first converting to LINQ expression trees 88 | 89 | Exceptions: InvalidArgumentException will be raised if the input expression is 90 | not in the subset that can be converted to a LINQ expression tree 91 | 92 | 93 | 94 | 95 | Compile the quotation expression by first converting to LINQ expression trees 96 | 97 | Exceptions: InvalidArgumentException will be raised if the input expression is 98 | not in the subset that can be converted to a LINQ expression tree 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | An intrinsic for compiling <c>&lt;@ x <> y @&gt;</c> to expression trees 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | This join operator implements the LINQ GroupJoin operator and the <c>query</c> convertor recognises it as such 115 | 116 | 117 | 118 | 119 | This join operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 120 | 121 | 122 | 123 | 124 | When used in queries, this operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 125 | 126 | 127 | 128 | 129 | When used in queries, this operator corresponds to the LINQ Max operator and the <c>query</c> convertor recognises it as such 130 | It differs in return type from <c>Seq.maxBy</c> 131 | 132 | 133 | 134 | 135 | When used in queries, this operator corresponds to the LINQ Min operator and the <c>query</c> convertor recognises it as such 136 | It differs in return type from <c>Seq.minBy</c> 137 | 138 | 139 | 140 | 141 | When used in queries, this operator corresponds to the LINQ Contains operator and the <c>query</c> convertor recognises it as such 142 | 143 | 144 | 145 | 146 | Evaluate the quotation expression by first converting to a LINQ expression tree 147 | making use of IQueryable operators and then executing expression tree 148 | 149 | Exceptions: <c>InvalidArgumentException</c> will be raised if the input expression is 150 | not in the subset that can be converted to a LINQ expression tree 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | This function should not be called directly. 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | A set of types used for implementing quotation conversions. 356 | These are public only because targets of Linq Lambda expressions require them to be so 357 | 358 | 359 | 360 | 361 | This module provides Compile and Eval extension members 362 | for F# quotation values, implemented by translating to LINQ 363 | expression trees and using the LINQ dynamic compiler. 364 | 365 | 366 | 367 | 368 | -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.Metadata.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net20/FSharp.PowerPack.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Linq.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Linq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.PowerPack.Linq 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Convert the quotation expression to LINQ expression trees 59 | 60 | This operation will only succeed for a subset of quotation expressions. 61 | 62 | Exceptions: InvalidArgumentException will be raised if the input expression is 63 | not in the subset that can be converted to a LINQ expression tree 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Compile the quotation expression by first converting to LINQ expression trees 72 | 73 | Exceptions: InvalidArgumentException will be raised if the input expression is 74 | not in the subset that can be converted to a LINQ expression tree 75 | 76 | 77 | 78 | 79 | Evaluate the quotation expression by first converting to LINQ expression trees 80 | 81 | Exceptions: InvalidArgumentException will be raised if the input expression is 82 | not in the subset that can be converted to a LINQ expression tree 83 | 84 | 85 | 86 | 87 | Compile the quotation expression by first converting to LINQ expression trees 88 | 89 | Exceptions: InvalidArgumentException will be raised if the input expression is 90 | not in the subset that can be converted to a LINQ expression tree 91 | 92 | 93 | 94 | 95 | Compile the quotation expression by first converting to LINQ expression trees 96 | 97 | Exceptions: InvalidArgumentException will be raised if the input expression is 98 | not in the subset that can be converted to a LINQ expression tree 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | An intrinsic for compiling <c>&lt;@ x <> y @&gt;</c> to expression trees 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | This join operator implements the LINQ GroupJoin operator and the <c>query</c> convertor recognises it as such 115 | 116 | 117 | 118 | 119 | This join operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 120 | 121 | 122 | 123 | 124 | When used in queries, this operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 125 | 126 | 127 | 128 | 129 | When used in queries, this operator corresponds to the LINQ Max operator and the <c>query</c> convertor recognises it as such 130 | It differs in return type from <c>Seq.maxBy</c> 131 | 132 | 133 | 134 | 135 | When used in queries, this operator corresponds to the LINQ Min operator and the <c>query</c> convertor recognises it as such 136 | It differs in return type from <c>Seq.minBy</c> 137 | 138 | 139 | 140 | 141 | When used in queries, this operator corresponds to the LINQ Contains operator and the <c>query</c> convertor recognises it as such 142 | 143 | 144 | 145 | 146 | Evaluate the quotation expression by first converting to a LINQ expression tree 147 | making use of IQueryable operators and then executing expression tree 148 | 149 | Exceptions: <c>InvalidArgumentException</c> will be raised if the input expression is 150 | not in the subset that can be converted to a LINQ expression tree 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | This function should not be called directly. 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | A set of types used for implementing quotation conversions. 356 | These are public only because targets of Linq Lambda expressions require them to be so 357 | 358 | 359 | 360 | 361 | This module provides Compile and Eval extension members 362 | for F# quotation values, implemented by translating to LINQ 363 | expression trees and using the LINQ dynamic compiler. 364 | 365 | 366 | 367 | 368 | -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Metadata.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Parallel.Seq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.Parallel.Seq.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/Net40/FSharp.PowerPack.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/sl3/FSharp.PowerPack.Compatibility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/sl3/FSharp.PowerPack.Compatibility.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/sl3/FSharp.PowerPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/sl3/FSharp.PowerPack.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/sl4/FSharp.PowerPack.Compatibility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/sl4/FSharp.PowerPack.Compatibility.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Lib/sl4/FSharp.PowerPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Lib/sl4/FSharp.PowerPack.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.Compiler.CodeDom.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.Compiler.CodeDom.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Build.Tasks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Build.Tasks.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Build.Tasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.PowerPack.Build.Tasks 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Convert string into Option string where null and String.Empty result in None 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Compatibility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Compatibility.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Linq.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Linq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.PowerPack.Linq 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Convert the quotation expression to LINQ expression trees 59 | 60 | This operation will only succeed for a subset of quotation expressions. 61 | 62 | Exceptions: InvalidArgumentException will be raised if the input expression is 63 | not in the subset that can be converted to a LINQ expression tree 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Compile the quotation expression by first converting to LINQ expression trees 72 | 73 | Exceptions: InvalidArgumentException will be raised if the input expression is 74 | not in the subset that can be converted to a LINQ expression tree 75 | 76 | 77 | 78 | 79 | Evaluate the quotation expression by first converting to LINQ expression trees 80 | 81 | Exceptions: InvalidArgumentException will be raised if the input expression is 82 | not in the subset that can be converted to a LINQ expression tree 83 | 84 | 85 | 86 | 87 | Compile the quotation expression by first converting to LINQ expression trees 88 | 89 | Exceptions: InvalidArgumentException will be raised if the input expression is 90 | not in the subset that can be converted to a LINQ expression tree 91 | 92 | 93 | 94 | 95 | Compile the quotation expression by first converting to LINQ expression trees 96 | 97 | Exceptions: InvalidArgumentException will be raised if the input expression is 98 | not in the subset that can be converted to a LINQ expression tree 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | An intrinsic for compiling <c>&lt;@ x <> y @&gt;</c> to expression trees 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | This join operator implements the LINQ GroupJoin operator and the <c>query</c> convertor recognises it as such 115 | 116 | 117 | 118 | 119 | This join operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 120 | 121 | 122 | 123 | 124 | When used in queries, this operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 125 | 126 | 127 | 128 | 129 | When used in queries, this operator corresponds to the LINQ Max operator and the <c>query</c> convertor recognises it as such 130 | It differs in return type from <c>Seq.maxBy</c> 131 | 132 | 133 | 134 | 135 | When used in queries, this operator corresponds to the LINQ Min operator and the <c>query</c> convertor recognises it as such 136 | It differs in return type from <c>Seq.minBy</c> 137 | 138 | 139 | 140 | 141 | When used in queries, this operator corresponds to the LINQ Contains operator and the <c>query</c> convertor recognises it as such 142 | 143 | 144 | 145 | 146 | Evaluate the quotation expression by first converting to a LINQ expression tree 147 | making use of IQueryable operators and then executing expression tree 148 | 149 | Exceptions: <c>InvalidArgumentException</c> will be raised if the input expression is 150 | not in the subset that can be converted to a LINQ expression tree 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | This function should not be called directly. 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | A set of types used for implementing quotation conversions. 356 | These are public only because targets of Linq Lambda expressions require them to be so 357 | 358 | 359 | 360 | 361 | This module provides Compile and Eval extension members 362 | for F# quotation values, implemented by translating to LINQ 363 | expression trees and using the LINQ dynamic compiler. 364 | 365 | 366 | 367 | 368 | -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Metadata.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Parallel.Seq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.Parallel.Seq.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.dll -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/FSharp.PowerPack.targets: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 | CallFsLex;CallFsYacc;$(CompileDependsOn) 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 55 | 56 | 57 | 58 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | false 77 | 78 | 79 | false 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/fshtmldoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/fshtmldoc.exe -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/fslex.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/fslex.exe -------------------------------------------------------------------------------- /packages/FSPowerPack.Community.2.0.0.0/Tools/fsyacc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/FSPowerPack.Community.2.0.0.0/Tools/fsyacc.exe -------------------------------------------------------------------------------- /packages/Npgsql.2.0.11/lib/Net11/Mono.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/Npgsql.2.0.11/lib/Net11/Mono.Security.dll -------------------------------------------------------------------------------- /packages/Npgsql.2.0.11/lib/Net11/Npgsql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/Npgsql.2.0.11/lib/Net11/Npgsql.dll -------------------------------------------------------------------------------- /packages/Npgsql.2.0.11/lib/Net35/Mono.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/Npgsql.2.0.11/lib/Net35/Mono.Security.dll -------------------------------------------------------------------------------- /packages/Npgsql.2.0.11/lib/Net35/Npgsql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/Npgsql.2.0.11/lib/Net35/Npgsql.dll -------------------------------------------------------------------------------- /packages/Npgsql.2.0.11/lib/Net40/Mono.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/Npgsql.2.0.11/lib/Net40/Mono.Security.dll -------------------------------------------------------------------------------- /packages/Npgsql.2.0.11/lib/Net40/Npgsql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/Npgsql.2.0.11/lib/Net40/Npgsql.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/Content/web.config.transform: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= 6 | -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/README_ENU.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/README_ENU.txt -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/msvcr90.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/msvcr90.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcecompact40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcecompact40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceer40EN.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceer40EN.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceme40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceme40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceqp40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceqp40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcese40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcese40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= 6 | -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/README_ENU.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/README_ENU.txt -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/msvcr90.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/msvcr90.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcecompact40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcecompact40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceer40EN.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceer40EN.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceme40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceme40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceqp40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceqp40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcese40.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcese40.dll -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/SqlServerCompact.4.0.8482.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/SqlServerCompact.4.0.8482.1.nupkg -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/Tools/GetSqlCEPostBuildCmd.ps1: -------------------------------------------------------------------------------- 1 | $solutionDir = [System.IO.Path]::GetDirectoryName($dte.Solution.FullName) + "\" 2 | $path = $installPath.Replace($solutionDir, "`$(SolutionDir)") 3 | 4 | $NativeAssembliesDir = Join-Path $path "NativeBinaries" 5 | $x86 = $(Join-Path $NativeAssembliesDir "x86\*.*") 6 | $x64 = $(Join-Path $NativeAssembliesDir "amd64\*.*") 7 | 8 | $SqlCEPostBuildCmd = " 9 | if not exist `"`$(TargetDir)x86`" md `"`$(TargetDir)x86`" 10 | xcopy /s /y `"$x86`" `"`$(TargetDir)x86`" 11 | if not exist `"`$(TargetDir)amd64`" md `"`$(TargetDir)amd64`" 12 | xcopy /s /y `"$x64`" `"`$(TargetDir)amd64`"" -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/Tools/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | . (Join-Path $toolsPath "GetSqlCEPostBuildCmd.ps1") 4 | 5 | # Get the current Post Build Event cmd 6 | $currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value 7 | 8 | # Append our post build command if it's not already there 9 | if (!$currentPostBuildCmd.Contains($SqlCEPostBuildCmd)) { 10 | $project.Properties.Item("PostBuildEvent").Value += $SqlCEPostBuildCmd 11 | } 12 | -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/Tools/uninstall.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | . (Join-Path $toolsPath "GetSqlCEPostBuildCmd.ps1") 4 | 5 | # Get the current Post Build Event cmd 6 | $currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value 7 | 8 | # Remove our post build command from it (if it's there) 9 | $project.Properties.Item("PostBuildEvent").Value = $currentPostBuildCmd.Replace($SqlCEPostBuildCmd, "") 10 | -------------------------------------------------------------------------------- /packages/SqlServerCompact.4.0.8482.1/lib/System.Data.SqlServerCe.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bkaid/dapper-dot-net/52bc50e6f0a618e2d53c47403f63d11df8334c36/packages/SqlServerCompact.4.0.8482.1/lib/System.Data.SqlServerCe.dll -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------