├── src ├── .vs │ └── Z.Dapper.Plus │ │ ├── v17 │ │ └── fileList.bin │ │ ├── v16 │ │ └── TestStore │ │ │ └── 0 │ │ │ ├── 000.testlog │ │ │ └── testlog.manifest │ │ └── FileContentIndex │ │ ├── 04ce44b1-2ac8-4c47-828b-1a9b2dc0a4b4.vsidx │ │ └── d1d26758-cfe3-40e7-a2f4-87efe38ce135.vsidx ├── test │ └── Z.Test │ │ ├── packages.config │ │ ├── Mapper │ │ ├── MapMapped_MapMapped │ │ │ ├── global_class.cs │ │ │ ├── 0067.cs │ │ │ ├── 0068.cs │ │ │ ├── 0069.cs │ │ │ └── 0070.cs │ │ ├── MapMapper_MapMapper │ │ │ └── global_class.cs │ │ ├── IgnoreMapper_IgnoreMapper │ │ │ └── global_class.cs │ │ ├── OutputMapped_OutputMapped │ │ │ ├── global_class.cs │ │ │ ├── 0077.cs │ │ │ └── 0078.cs │ │ ├── OutputMapper_OutputMapper │ │ │ ├── global_class.cs │ │ │ ├── 0047.cs │ │ │ ├── 0057.cs │ │ │ ├── 0048.cs │ │ │ ├── 0052.cs │ │ │ ├── 0050.cs │ │ │ ├── 0058.cs │ │ │ ├── 0060.cs │ │ │ ├── 0062.cs │ │ │ ├── 0049.cs │ │ │ ├── 0053.cs │ │ │ ├── 0055.cs │ │ │ ├── 0059.cs │ │ │ ├── 0063.cs │ │ │ ├── 0051.cs │ │ │ ├── 0054.cs │ │ │ ├── 0061.cs │ │ │ ├── 0065.cs │ │ │ ├── 0056.cs │ │ │ └── 0064.cs │ │ └── IdentityMapper_IdentityMapper │ │ │ ├── global_class.cs │ │ │ ├── 0027.cs │ │ │ ├── 0037.cs │ │ │ ├── 0028.cs │ │ │ ├── 0032.cs │ │ │ ├── 0030.cs │ │ │ ├── 0038.cs │ │ │ ├── 0040.cs │ │ │ ├── 0042.cs │ │ │ ├── 0029.cs │ │ │ ├── 0033.cs │ │ │ ├── 0039.cs │ │ │ ├── 0035.cs │ │ │ ├── 0031.cs │ │ │ ├── 0043.cs │ │ │ ├── 0034.cs │ │ │ ├── 0041.cs │ │ │ ├── 0045.cs │ │ │ └── 0036.cs │ │ ├── BulkAction │ │ ├── BulkDelete_Parameter │ │ │ └── global_class.cs │ │ ├── BulkInsert_Parameter │ │ │ └── global_class.cs │ │ ├── BulkMerge_Parameter │ │ │ └── global_class.cs │ │ ├── BulkUpdate_Parameter │ │ │ └── global_class.cs │ │ ├── BulkDelete_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_SingleMixedSelector │ │ │ └── global_class.cs │ │ └── BulkUpdate_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── Include │ │ ├── ThenBulkMerge_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkDelete_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkInsert_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkMerge_SingleSelector │ │ │ └── global_class.cs │ │ ├── ThenBulkUpdate_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkDelete_SingleSelector │ │ │ └── global_class.cs │ │ ├── ThenBulkInsert_SingleSelector │ │ │ └── global_class.cs │ │ └── ThenBulkUpdate_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkActionAsync │ │ ├── BulkDelete_Parameter │ │ │ └── global_class.cs │ │ ├── BulkInsert_Parameter │ │ │ └── global_class.cs │ │ ├── BulkMerge_Parameter │ │ │ └── global_class.cs │ │ ├── BulkUpdate_Parameter │ │ │ └── global_class.cs │ │ ├── BulkDelete_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_SingleMixedSelector │ │ │ └── global_class.cs │ │ └── BulkUpdate_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── Bulk_BulkAction │ │ ├── BulkDelete_Parameter │ │ │ └── global_class.cs │ │ ├── BulkInsert_Parameter │ │ │ └── global_class.cs │ │ ├── BulkMerge_Parameter │ │ │ └── global_class.cs │ │ ├── BulkUpdate_Parameter │ │ │ └── global_class.cs │ │ ├── BulkDelete_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_ManySelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_SingleSelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkUpdate_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkDelete_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkInsert_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── BulkMerge_SingleMixedSelector │ │ │ └── global_class.cs │ │ └── BulkUpdate_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoAction │ │ ├── AlsoBulkDelete_ManySelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkInsert_ManySelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkMerge_ManySelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkMerge_SingleSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkUpdate_ManySelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkDelete_SingleSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkInsert_SingleSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkUpdate_SingleSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkDelete_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkInsert_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkMerge_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkMerge_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkUpdate_ManyMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkDelete_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── AlsoBulkInsert_SingleMixedSelector │ │ │ └── global_class.cs │ │ └── AlsoBulkUpdate_SingleMixedSelector │ │ │ └── global_class.cs │ │ ├── ThenAction │ │ ├── ThenBulkDelete_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkInsert_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkMerge_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkMerge_SingleSelector │ │ │ └── global_class.cs │ │ ├── ThenBulkUpdate_ManySelector │ │ │ └── global_class.cs │ │ ├── ThenBulkDelete_SingleSelector │ │ │ └── global_class.cs │ │ ├── ThenBulkInsert_SingleSelector │ │ │ └── global_class.cs │ │ └── ThenBulkUpdate_SingleSelector │ │ │ └── global_class.cs │ │ ├── App.config │ │ ├── Z.Test.csproj.vspscc │ │ ├── My.cs │ │ ├── _Model │ │ ├── EntitySimple_Mapper.cs │ │ └── SingleMany.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── UnitTest1.cs └── Z.Dapper.Plus.sln ├── .gitignore ├── .gitattributes ├── NuGet.md └── .github └── ISSUE_TEMPLATE.md /src/.vs/Z.Dapper.Plus/v17/fileList.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzzprojects/Dapper-Plus/HEAD/src/.vs/Z.Dapper.Plus/v17/fileList.bin -------------------------------------------------------------------------------- /src/.vs/Z.Dapper.Plus/v16/TestStore/0/000.testlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzzprojects/Dapper-Plus/HEAD/src/.vs/Z.Dapper.Plus/v16/TestStore/0/000.testlog -------------------------------------------------------------------------------- /src/.vs/Z.Dapper.Plus/v16/TestStore/0/testlog.manifest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzzprojects/Dapper-Plus/HEAD/src/.vs/Z.Dapper.Plus/v16/TestStore/0/testlog.manifest -------------------------------------------------------------------------------- /src/test/Z.Test/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Bb]in/ 2 | [Oo]bj/ 3 | [Pp]ackages/ 4 | Z.Expressions.Eval.NET40/ 5 | Z.Lab/ 6 | *.suo 7 | *.user 8 | *.userprefs 9 | _ReSharper.* 10 | *.ReSharper.user 11 | *.resharper.user 12 | -------------------------------------------------------------------------------- /src/.vs/Z.Dapper.Plus/FileContentIndex/04ce44b1-2ac8-4c47-828b-1a9b2dc0a4b4.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzzprojects/Dapper-Plus/HEAD/src/.vs/Z.Dapper.Plus/FileContentIndex/04ce44b1-2ac8-4c47-828b-1a9b2dc0a4b4.vsidx -------------------------------------------------------------------------------- /src/.vs/Z.Dapper.Plus/FileContentIndex/d1d26758-cfe3-40e7-a2f4-87efe38ce135.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzzprojects/Dapper-Plus/HEAD/src/.vs/Z.Dapper.Plus/FileContentIndex/d1d26758-cfe3-40e7-a2f4-87efe38ce135.vsidx -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/MapMapped_MapMapped/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Mapper_MapMapped_MapMapped 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/MapMapper_MapMapper/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Mapper_MapMapper_MapMapper 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkDelete_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkDelete_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkInsert_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkInsert_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkMerge_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkMerge_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkUpdate_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkUpdate_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkDelete_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkDelete_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkInsert_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkInsert_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkMerge_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkMerge_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkUpdate_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkUpdate_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkMerge_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkMerge_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IgnoreMapper_IgnoreMapper/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Mapper_IgnoreMapper_IgnoreMapper 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapped_OutputMapped/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Mapper_OutputMapped_OutputMapped 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Mapper_OutputMapper_OutputMapper 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkDelete_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkDelete_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkInsert_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkInsert_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkMerge_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkMerge_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkUpdate_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkUpdate_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkDelete_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkDelete_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkInsert_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkInsert_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkMerge_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkMerge_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkUpdate_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkUpdate_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkDelete_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkDelete_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkInsert_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkInsert_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkMerge_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkMerge_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkUpdate_Parameter/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkUpdate_Parameter 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkDelete_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkDelete_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkInsert_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkInsert_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkMerge_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkMerge_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkUpdate_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkUpdate_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Mapper_IdentityMapper_IdentityMapper 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkDelete_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkDelete_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkInsert_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkInsert_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkMerge_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkMerge_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkMerge_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkMerge_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkUpdate_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkUpdate_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkDelete_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkDelete_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkInsert_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkInsert_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkMerge_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkMerge_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkUpdate_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkUpdate_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkDelete_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkDelete_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkInsert_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkInsert_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkMerge_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkMerge_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkUpdate_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkUpdate_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkDelete_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkDelete_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkInsert_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkInsert_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkMerge_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkMerge_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkUpdate_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkUpdate_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkDelete_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkDelete_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkInsert_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkInsert_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Include/ThenBulkUpdate_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Include_ThenBulkUpdate_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkDelete_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkDelete_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkInsert_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkInsert_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkMerge_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkMerge_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkMerge_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkMerge_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkUpdate_ManySelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkUpdate_ManySelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkDelete_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkDelete_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkInsert_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkInsert_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkUpdate_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkUpdate_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkDelete_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkDelete_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkInsert_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkInsert_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkMerge_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkMerge_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkAction/BulkUpdate_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkAction_BulkUpdate_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkDelete_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkDelete_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkInsert_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkInsert_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkMerge_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkMerge_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkUpdate_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkUpdate_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkDelete_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkDelete_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkInsert_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkInsert_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkMerge_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkMerge_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkUpdate_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkUpdate_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkDelete_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkDelete_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkInsert_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkInsert_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/ThenAction/ThenBulkUpdate_SingleSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class ThenAction_ThenBulkUpdate_SingleSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkDelete_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkDelete_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkInsert_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkInsert_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkMerge_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkMerge_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkMerge_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkMerge_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkUpdate_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkUpdate_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkDelete_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkDelete_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkInsert_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkInsert_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkMerge_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkMerge_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkUpdate_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkUpdate_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkDelete_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkDelete_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkInsert_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkInsert_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkMerge_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkMerge_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkUpdate_ManyMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkUpdate_ManyMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkDelete_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkDelete_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkInsert_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkInsert_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/AlsoAction/AlsoBulkUpdate_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class AlsoAction_AlsoBulkUpdate_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkDelete_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkDelete_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkInsert_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkInsert_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkMerge_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkMerge_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/BulkActionAsync/BulkUpdate_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class BulkActionAsync_BulkUpdate_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkDelete_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkDelete_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkInsert_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkInsert_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkMerge_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkMerge_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/Bulk_BulkAction/BulkUpdate_SingleMixedSelector/global_class.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Z.Test 4 | { 5 | [TestClass] 6 | public partial class Bulk_BulkAction_BulkUpdate_SingleMixedSelector 7 | { 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/Z.Test/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/Z.Test/Z.Test.csproj.vspscc: -------------------------------------------------------------------------------- 1 | "" 2 | { 3 | "FILE_VERSION" = "9237" 4 | "ENLISTMENT_CHOICE" = "NEVER" 5 | "PROJECT_FILE_RELATIVE_PATH" = "" 6 | "NUMBER_OF_EXCLUDED_FILES" = "0" 7 | "ORIGINAL_PROJECT_FILE_PATH" = "" 8 | "NUMBER_OF_NESTED_PROJECTS" = "0" 9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" 10 | } 11 | -------------------------------------------------------------------------------- /src/test/Z.Test/My.cs: -------------------------------------------------------------------------------- 1 | using System.Configuration; 2 | 3 | namespace Z.Test 4 | { 5 | public static class My 6 | { 7 | public class ConnectionStrings 8 | { 9 | public static string DapperPlusConnection = ConfigurationManager.ConnectionStrings["DapperPlusConnection"].ConnectionString; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/Z.Test/_Model/EntitySimple_Mapper.cs: -------------------------------------------------------------------------------- 1 | namespace Z.Test 2 | { 3 | public class EntitySimple_Mapper 4 | { 5 | public int Many1 { get; set; } 6 | public int Many2 { get; set; } 7 | public int Many3 { get; set; } 8 | public int Many4 { get; set; } 9 | public int Single1 { get; set; } 10 | public int Single2 { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /src/test/Z.Test/_Model/SingleMany.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Z.Test 4 | { 5 | public class SingleMany 6 | { 7 | public int ID { get; set; } 8 | 9 | public int ColumnInt { get; set; } 10 | 11 | public int ColumnUpdateInt { get; set; } 12 | 13 | public SingleMany Single1 { get; set; } 14 | public SingleMany Single2 { get; set; } 15 | public SingleMany Single3 { get; set; } 16 | 17 | public List Many1 { get; set; } 18 | public List Many2 { get; set; } 19 | public List Many3 { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /NuGet.md: -------------------------------------------------------------------------------- 1 | Extend your IDbConnection with high-performance bulk operations 2 | 3 | ## Url 4 | 5 | - [Website](https://dapper-plus.net/) 6 | - [Getting Started](https://dapper-plus.net/overview) 7 | - [Documentation](https://dapper-plus.net/bulk-insert) 8 | - [Online Examples](https://dapper-plus.net/online-examples) 9 | 10 | ## Example 11 | 12 | ```csharp 13 | DapperPlusManager.Entity().Identity(x => x.InvoiceID, true); 14 | DapperPlusManager.Entity().Identity(x => x.InvoiceItemID, true); 15 | 16 | // ...code... 17 | 18 | connection.BulkInsert(invoices, x => x.InvoiceMeta, x => x.InvoiceItems); 19 | ``` 20 | 21 | Try it: [https://dotnetfiddle.net/LBfItU](https://dotnetfiddle.net/LBfItU) 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | Describe the issue or proposed feature. 3 | 4 | ### Exception 5 | If you are seeing an exception, include the full exceptions details (message and stack trace). 6 | 7 | ``` 8 | Exception message: 9 | Stack trace: 10 | ``` 11 | 12 | ### Fiddle or Project (Optional) 13 | If you are able, 14 | 15 | Provide a Fiddle that reproduces the issue: https://dotnetfiddle.net/kV5RHX 16 | 17 | Or provide a project/solution that we can run to reproduce the issue. 18 | - Make sure the project compile 19 | - Make sure to provide only the code that is required to reproduce the issue, not the whole project 20 | - You can send private code here: info@zzzprojects.com 21 | 22 | Otherwise, make sure to include as much information as possible to help our team to reproduce the issue. 23 | 24 | _Note: More information you provide, faster we can implement a solution._ 25 | 26 | ### Further technical details 27 | - Dapper version: [Dapper v2.1.15] 28 | - Dapper Plus version: [Dapper Plus v6.0.5] 29 | - Database Server version: [SQL Server 2002] 30 | - Database Provider version (NuGet): [Microsoft.Data.SqlClient v5.1.2] 31 | -------------------------------------------------------------------------------- /src/test/Z.Test/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("Z.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Z.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 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("fb0fa303-3c92-4047-8960-79a660e34975")] 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 | -------------------------------------------------------------------------------- /src/Z.Dapper.Plus.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{84908C69-D5B3-4615-9D28-E65B7FD64FBD}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Z.Test", "test\Z.Test\Z.Test.csproj", "{FB0FA303-3C92-4047-8960-79A660E34975}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {13E580C8-6E58-4CA0-933B-4ACB1E8D0593}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {13E580C8-6E58-4CA0-933B-4ACB1E8D0593}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {13E580C8-6E58-4CA0-933B-4ACB1E8D0593}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {13E580C8-6E58-4CA0-933B-4ACB1E8D0593}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {DCB2A0F8-0619-4C45-870F-FA2676FBB9B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {DCB2A0F8-0619-4C45-870F-FA2676FBB9B5}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {DCB2A0F8-0619-4C45-870F-FA2676FBB9B5}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {DCB2A0F8-0619-4C45-870F-FA2676FBB9B5}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {FB0FA303-3C92-4047-8960-79A660E34975}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {FB0FA303-3C92-4047-8960-79A660E34975}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {FB0FA303-3C92-4047-8960-79A660E34975}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {FB0FA303-3C92-4047-8960-79A660E34975}.Release|Any CPU.Build.0 = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | GlobalSection(NestedProjects) = preSolution 33 | {FB0FA303-3C92-4047-8960-79A660E34975} = {84908C69-D5B3-4615-9D28-E65B7FD64FBD} 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /src/test/Z.Test/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using Z.Dapper.Plus; 5 | 6 | namespace Z.Test 7 | { 8 | [TestClass] 9 | public class UnitTest1 10 | { 11 | [TestMethod] 12 | public void TestMethod1() 13 | { 14 | Helper.CleanDatabase(); 15 | 16 | var single1 = new SingleMany {ColumnInt = 1}; 17 | var single2 = new SingleMany {ColumnInt = 8}; 18 | var single3 = new SingleMany {ColumnInt = 64}; 19 | 20 | var many1 = new List {new SingleMany {ColumnInt = 512}, new SingleMany {ColumnInt = 1024}, new SingleMany {ColumnInt = 2048}}; // 3584 21 | var many2 = new List {new SingleMany {ColumnInt = 4096}, new SingleMany {ColumnInt = 8192}, new SingleMany {ColumnInt = 16384}}; // 28672 22 | var many3 = new List {new SingleMany {ColumnInt = 32768}, new SingleMany {ColumnInt = 65536}, new SingleMany {ColumnInt = 131072}}; // 229376 23 | 24 | Helper.LinkSingleMany(single1, single2, single3, many1, many2, many3); 25 | Helper.InsertFromMetas(new List() {"BulkInsertAll"}, single1, single2, single3, many1, many2, many3); 26 | Helper.UpdateFromMetas(new List() {"BulkInsertAll"}, single1, single2, single3, many1, many2, many3); 27 | 28 | using (var cn = Helper.GetConnection()) 29 | { 30 | //cn.BulkInsert(many1).ThenBulkInsert(x => x.ColumnInt); 31 | 32 | cn.Open(); 33 | 34 | // PreTest 35 | } 36 | 37 | using (var cn = Helper.GetConnection()) 38 | { 39 | cn.Open(); 40 | 41 | // Action 42 | } 43 | 44 | 45 | // GET count 46 | int columnInt = 0; 47 | int columnUpdateInt = 0; 48 | int columnInt_Key = 0; 49 | int columnUpdateInt_Key = 0; 50 | 51 | using (var connection = Helper.GetConnection()) 52 | { 53 | connection.Open(); 54 | 55 | using (var command = connection.CreateCommand()) 56 | { 57 | command.CommandText = "SELECT SUM(ColumnInt) FROM SingleMany"; 58 | columnInt = Convert.ToInt32(command.ExecuteScalar()); 59 | 60 | command.CommandText = "SELECT SUM(ColumnUpdateInt) FROM SingleMany"; 61 | columnUpdateInt = Convert.ToInt32(command.ExecuteScalar()); 62 | 63 | command.CommandText = "SELECT SUM(ColumnInt) FROM SingleMany_Key"; 64 | columnInt_Key = Convert.ToInt32(command.ExecuteScalar()); 65 | 66 | command.CommandText = "SELECT SUM(ColumnUpdateInt) FROM SingleMany_Key"; 67 | columnUpdateInt_Key = Convert.ToInt32(command.ExecuteScalar()); 68 | } 69 | } 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapped_OutputMapped/0077.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapped_OutputMapped 16 | { 17 | [TestMethod] 18 | public void Z_Test_0077() 19 | { 20 | // Title2: Output_NotMapped 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | Exception ex = null; 35 | try 36 | { 37 | DapperPlusManager.Entity("42190a57-70b7-42ae-83b6-671cf622c3e2").Map(x => x.Single1).Output(x => x.Single2);cn.BulkInsert("42190a57-70b7-42ae-83b6-671cf622c3e2", single); 38 | } 39 | catch(Exception exception) 40 | { 41 | ex = exception; 42 | } 43 | Assert.IsNotNull(ex); 44 | Assert.AreEqual("Specified cast is not valid.", ex.Message); 45 | return; 46 | } 47 | 48 | // GET count 49 | int single1 = 0; 50 | int single2 = 0; 51 | int many1 = 0; 52 | int many2 = 0; 53 | int many3 = 0; 54 | int many4 = 0; 55 | 56 | int single1_Destination = 0; 57 | int single2_Destination = 0; 58 | int many1_Destination = 0; 59 | int many2_Destination = 0; 60 | int many3_Destination = 0; 61 | int many4_Destination = 0; 62 | 63 | using (var connection = Helper.GetConnection()) 64 | { 65 | connection.Open(); 66 | 67 | using (var command = connection.CreateCommand()) 68 | { 69 | 70 | command.CommandText = @" 71 | SELECT TOP 1 72 | [Single1] , 73 | [Single2] , 74 | [Many1] , 75 | [Many2] , 76 | [Many3] , 77 | [Many4] , 78 | [Single1_Destination] , 79 | [Single2_Destination] , 80 | [Many1_Destination] , 81 | [Many2_Destination] , 82 | [Many3_Destination] , 83 | [Many4_Destination] " + 84 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 85 | 86 | using (var reader = command.ExecuteReader()) 87 | { 88 | reader.Read(); 89 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 90 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 91 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 92 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 93 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 94 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 95 | 96 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 97 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 98 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 99 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 100 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 101 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 102 | } 103 | } 104 | } 105 | 106 | // Test 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapped_OutputMapped/0078.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapped_OutputMapped 16 | { 17 | [TestMethod] 18 | public void Z_Test_0078() 19 | { 20 | // Title2: OutputDestination_NotMapped 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | Exception ex = null; 35 | try 36 | { 37 | DapperPlusManager.Entity("2d8b65de-c5be-45b6-b863-079fce14c392").Map(x => x.Single1).Output(x => x.Single2, "Single2");cn.BulkInsert("2d8b65de-c5be-45b6-b863-079fce14c392", single); 38 | } 39 | catch(Exception exception) 40 | { 41 | ex = exception; 42 | } 43 | Assert.IsNotNull(ex); 44 | Assert.AreEqual("Specified cast is not valid.", ex.Message); 45 | return; 46 | } 47 | 48 | // GET count 49 | int single1 = 0; 50 | int single2 = 0; 51 | int many1 = 0; 52 | int many2 = 0; 53 | int many3 = 0; 54 | int many4 = 0; 55 | 56 | int single1_Destination = 0; 57 | int single2_Destination = 0; 58 | int many1_Destination = 0; 59 | int many2_Destination = 0; 60 | int many3_Destination = 0; 61 | int many4_Destination = 0; 62 | 63 | using (var connection = Helper.GetConnection()) 64 | { 65 | connection.Open(); 66 | 67 | using (var command = connection.CreateCommand()) 68 | { 69 | 70 | command.CommandText = @" 71 | SELECT TOP 1 72 | [Single1] , 73 | [Single2] , 74 | [Many1] , 75 | [Many2] , 76 | [Many3] , 77 | [Many4] , 78 | [Single1_Destination] , 79 | [Single2_Destination] , 80 | [Many1_Destination] , 81 | [Many2_Destination] , 82 | [Many3_Destination] , 83 | [Many4_Destination] " + 84 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 85 | 86 | using (var reader = command.ExecuteReader()) 87 | { 88 | reader.Read(); 89 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 90 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 91 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 92 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 93 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 94 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 95 | 96 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 97 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 98 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 99 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 100 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 101 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 102 | } 103 | } 104 | } 105 | 106 | // Test 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/MapMapped_MapMapped/0067.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_MapMapped_MapMapped 16 | { 17 | [TestMethod] 18 | public void Z_Test_0067() 19 | { 20 | // Title2: Map_Mapped 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | Exception ex = null; 35 | try 36 | { 37 | DapperPlusManager.Entity("2a33f3fe-8ee0-4aa5-a4b7-bc83ba09d946").Map(x => x.Single1).Map(x => x.Single1);cn.BulkInsert("2a33f3fe-8ee0-4aa5-a4b7-bc83ba09d946", single); 38 | } 39 | catch(Exception exception) 40 | { 41 | ex = exception; 42 | } 43 | Assert.IsNotNull(ex); 44 | Assert.AreEqual("One of your column have a destination mapped more then once. See the inner exception for details.", ex.Message); 45 | return; 46 | } 47 | 48 | // GET count 49 | int single1 = 0; 50 | int single2 = 0; 51 | int many1 = 0; 52 | int many2 = 0; 53 | int many3 = 0; 54 | int many4 = 0; 55 | 56 | int single1_Destination = 0; 57 | int single2_Destination = 0; 58 | int many1_Destination = 0; 59 | int many2_Destination = 0; 60 | int many3_Destination = 0; 61 | int many4_Destination = 0; 62 | 63 | using (var connection = Helper.GetConnection()) 64 | { 65 | connection.Open(); 66 | 67 | using (var command = connection.CreateCommand()) 68 | { 69 | 70 | command.CommandText = @" 71 | SELECT TOP 1 72 | [Single1] , 73 | [Single2] , 74 | [Many1] , 75 | [Many2] , 76 | [Many3] , 77 | [Many4] , 78 | [Single1_Destination] , 79 | [Single2_Destination] , 80 | [Many1_Destination] , 81 | [Many2_Destination] , 82 | [Many3_Destination] , 83 | [Many4_Destination] " + 84 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 85 | 86 | using (var reader = command.ExecuteReader()) 87 | { 88 | reader.Read(); 89 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 90 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 91 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 92 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 93 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 94 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 95 | 96 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 97 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 98 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 99 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 100 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 101 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 102 | } 103 | } 104 | } 105 | 106 | // Test 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/MapMapped_MapMapped/0068.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_MapMapped_MapMapped 16 | { 17 | [TestMethod] 18 | public void Z_Test_0068() 19 | { 20 | // Title2: Map_MappedDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | Exception ex = null; 35 | try 36 | { 37 | DapperPlusManager.Entity("2ddee3b2-719c-4842-bb9e-6ca7bc55b044").Map(x => x.Single1, "Single1").Map(x => x.Single1);cn.BulkInsert("2ddee3b2-719c-4842-bb9e-6ca7bc55b044", single); 38 | } 39 | catch(Exception exception) 40 | { 41 | ex = exception; 42 | } 43 | Assert.IsNotNull(ex); 44 | Assert.AreEqual("One of your column have a destination mapped more then once. See the inner exception for details.", ex.Message); 45 | return; 46 | } 47 | 48 | // GET count 49 | int single1 = 0; 50 | int single2 = 0; 51 | int many1 = 0; 52 | int many2 = 0; 53 | int many3 = 0; 54 | int many4 = 0; 55 | 56 | int single1_Destination = 0; 57 | int single2_Destination = 0; 58 | int many1_Destination = 0; 59 | int many2_Destination = 0; 60 | int many3_Destination = 0; 61 | int many4_Destination = 0; 62 | 63 | using (var connection = Helper.GetConnection()) 64 | { 65 | connection.Open(); 66 | 67 | using (var command = connection.CreateCommand()) 68 | { 69 | 70 | command.CommandText = @" 71 | SELECT TOP 1 72 | [Single1] , 73 | [Single2] , 74 | [Many1] , 75 | [Many2] , 76 | [Many3] , 77 | [Many4] , 78 | [Single1_Destination] , 79 | [Single2_Destination] , 80 | [Many1_Destination] , 81 | [Many2_Destination] , 82 | [Many3_Destination] , 83 | [Many4_Destination] " + 84 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 85 | 86 | using (var reader = command.ExecuteReader()) 87 | { 88 | reader.Read(); 89 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 90 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 91 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 92 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 93 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 94 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 95 | 96 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 97 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 98 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 99 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 100 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 101 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 102 | } 103 | } 104 | } 105 | 106 | // Test 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/MapMapped_MapMapped/0069.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_MapMapped_MapMapped 16 | { 17 | [TestMethod] 18 | public void Z_Test_0069() 19 | { 20 | // Title2: MapDestination_Mapped 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | Exception ex = null; 35 | try 36 | { 37 | DapperPlusManager.Entity("86d24112-abfa-4739-a965-c894207ba83e").Map(x => x.Single1).Map(x => x.Single1, "Single1");cn.BulkInsert("86d24112-abfa-4739-a965-c894207ba83e", single); 38 | } 39 | catch(Exception exception) 40 | { 41 | ex = exception; 42 | } 43 | Assert.IsNotNull(ex); 44 | Assert.AreEqual("One of your column have a destination mapped more then once. See the inner exception for details.", ex.Message); 45 | return; 46 | } 47 | 48 | // GET count 49 | int single1 = 0; 50 | int single2 = 0; 51 | int many1 = 0; 52 | int many2 = 0; 53 | int many3 = 0; 54 | int many4 = 0; 55 | 56 | int single1_Destination = 0; 57 | int single2_Destination = 0; 58 | int many1_Destination = 0; 59 | int many2_Destination = 0; 60 | int many3_Destination = 0; 61 | int many4_Destination = 0; 62 | 63 | using (var connection = Helper.GetConnection()) 64 | { 65 | connection.Open(); 66 | 67 | using (var command = connection.CreateCommand()) 68 | { 69 | 70 | command.CommandText = @" 71 | SELECT TOP 1 72 | [Single1] , 73 | [Single2] , 74 | [Many1] , 75 | [Many2] , 76 | [Many3] , 77 | [Many4] , 78 | [Single1_Destination] , 79 | [Single2_Destination] , 80 | [Many1_Destination] , 81 | [Many2_Destination] , 82 | [Many3_Destination] , 83 | [Many4_Destination] " + 84 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 85 | 86 | using (var reader = command.ExecuteReader()) 87 | { 88 | reader.Read(); 89 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 90 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 91 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 92 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 93 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 94 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 95 | 96 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 97 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 98 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 99 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 100 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 101 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 102 | } 103 | } 104 | } 105 | 106 | // Test 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0047.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0047() 19 | { 20 | // Title2: OutputSingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("b82600c4-1d20-40a7-8cf1-a57ee9d1b56f").Table("EntitySimple_TriggerOutput").Output(x => x.Single1);cn.BulkInsert("b82600c4-1d20-40a7-8cf1-a57ee9d1b56f", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/MapMapped_MapMapped/0070.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_MapMapped_MapMapped 16 | { 17 | [TestMethod] 18 | public void Z_Test_0070() 19 | { 20 | // Title2: MapDestination_MappedDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | Exception ex = null; 35 | try 36 | { 37 | DapperPlusManager.Entity("b6dc0ae6-0cb2-417c-ab4b-eeb24b75de7c").Map(x => x.Single1, "Single1").Map(x => x.Single1, "Single1");cn.BulkInsert("b6dc0ae6-0cb2-417c-ab4b-eeb24b75de7c", single); 38 | } 39 | catch(Exception exception) 40 | { 41 | ex = exception; 42 | } 43 | Assert.IsNotNull(ex); 44 | Assert.AreEqual("One of your column have a destination mapped more then once. See the inner exception for details.", ex.Message); 45 | return; 46 | } 47 | 48 | // GET count 49 | int single1 = 0; 50 | int single2 = 0; 51 | int many1 = 0; 52 | int many2 = 0; 53 | int many3 = 0; 54 | int many4 = 0; 55 | 56 | int single1_Destination = 0; 57 | int single2_Destination = 0; 58 | int many1_Destination = 0; 59 | int many2_Destination = 0; 60 | int many3_Destination = 0; 61 | int many4_Destination = 0; 62 | 63 | using (var connection = Helper.GetConnection()) 64 | { 65 | connection.Open(); 66 | 67 | using (var command = connection.CreateCommand()) 68 | { 69 | 70 | command.CommandText = @" 71 | SELECT TOP 1 72 | [Single1] , 73 | [Single2] , 74 | [Many1] , 75 | [Many2] , 76 | [Many3] , 77 | [Many4] , 78 | [Single1_Destination] , 79 | [Single2_Destination] , 80 | [Many1_Destination] , 81 | [Many2_Destination] , 82 | [Many3_Destination] , 83 | [Many4_Destination] " + 84 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 85 | 86 | using (var reader = command.ExecuteReader()) 87 | { 88 | reader.Read(); 89 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 90 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 91 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 92 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 93 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 94 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 95 | 96 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 97 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 98 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 99 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 100 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 101 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 102 | } 103 | } 104 | } 105 | 106 | // Test 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0027.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0027() 19 | { 20 | // Title2: IdentitySingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("7924b882-209e-42b8-a008-8f0d4a16b4d3").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1);cn.BulkInsert("7924b882-209e-42b8-a008-8f0d4a16b4d3", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0057.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0057() 19 | { 20 | // Title2: OutputMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("30d7379e-138c-4cff-a813-d6e37792a050").Table("EntitySimple_TriggerOutput").Output(x => new {x.Many1, x.Many2});cn.BulkInsert("30d7379e-138c-4cff-a813-d6e37792a050", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0037.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0037() 19 | { 20 | // Title2: IdentityMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("f9b0ed54-1be8-444f-95d5-fdb6172dad50").Table("EntitySimple_TriggerOutput").Identity(x => new {x.Many1, x.Many2});cn.BulkInsert("f9b0ed54-1be8-444f-95d5-fdb6172dad50", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0048.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0048() 19 | { 20 | // Title2: OutputSingle_OutputSingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("bfd78c04-9c7e-40e7-a940-1cf37a0376ea").Table("EntitySimple_TriggerOutput").Output(x => x.Single1).Output(x => x.Single2);cn.BulkInsert("bfd78c04-9c7e-40e7-a940-1cf37a0376ea", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0052.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0052() 19 | { 20 | // Title2: OutputSingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("a1ac476a-acaf-46ed-92f2-cc11cc0ae944").Table("EntitySimple_TriggerOutput").Output(x => x.Single1, "Single1_Destination");cn.BulkInsert("a1ac476a-acaf-46ed-92f2-cc11cc0ae944", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0028.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0028() 19 | { 20 | // Title2: IdentitySingle_IdentitySingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("9b736b6b-0264-4f57-a577-cb1c2b3c5cbd").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1).Identity(x => x.Single2);cn.BulkInsert("9b736b6b-0264-4f57-a577-cb1c2b3c5cbd", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0032.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0032() 19 | { 20 | // Title2: IdentitySingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("266b6305-53b1-4205-b7ad-85953e8bf140").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1, "Single1_Destination");cn.BulkInsert("266b6305-53b1-4205-b7ad-85953e8bf140", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0050.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0050() 19 | { 20 | // Title2: OutputSingle_OutputMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("a2814140-2f0a-4f78-a470-e3429375170b").Table("EntitySimple_TriggerOutput").Output(x => x.Single1).Output(x => new { x.Many3, x.Many4});cn.BulkInsert("a2814140-2f0a-4f78-a470-e3429375170b", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0058.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0058() 19 | { 20 | // Title2: OutputMany_OutputSingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("b8d816a4-96d3-4365-908e-f951c4edb1af").Table("EntitySimple_TriggerOutput").Output(x => new {x.Many1, x.Many2}).Output(x => x.Single2);cn.BulkInsert("b8d816a4-96d3-4365-908e-f951c4edb1af", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0060.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0060() 19 | { 20 | // Title2: OutputMany_OutputMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("8201e060-e0f4-43df-a378-b834d602a88a").Table("EntitySimple_TriggerOutput").Output(x => new {x.Many1, x.Many2}).Output(x => new { x.Many3, x.Many4});cn.BulkInsert("8201e060-e0f4-43df-a378-b834d602a88a", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0030.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0030() 19 | { 20 | // Title2: IdentitySingle_IdentityMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("16f03bcf-3395-471b-885b-78c7f80b3eca").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1).Identity(x => new { x.Many3, x.Many4});cn.BulkInsert("16f03bcf-3395-471b-885b-78c7f80b3eca", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0038.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0038() 19 | { 20 | // Title2: IdentityMany_IdentitySingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("0e1790bc-1be8-4046-914f-df50f72f10cb").Table("EntitySimple_TriggerOutput").Identity(x => new {x.Many1, x.Many2}).Identity(x => x.Single2);cn.BulkInsert("0e1790bc-1be8-4046-914f-df50f72f10cb", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0062.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0062() 19 | { 20 | // Title2: OutputManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("f052f290-9cb8-41c6-ad1d-11939dc40cd1").Table("EntitySimple_TriggerOutput").Output(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2});cn.BulkInsert("f052f290-9cb8-41c6-ad1d-11939dc40cd1", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0040.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0040() 19 | { 20 | // Title2: IdentityMany_IdentityMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("16701426-10d2-4265-921f-d700eaa196fd").Table("EntitySimple_TriggerOutput").Identity(x => new {x.Many1, x.Many2}).Identity(x => new { x.Many3, x.Many4});cn.BulkInsert("16701426-10d2-4265-921f-d700eaa196fd", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0049.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0049() 19 | { 20 | // Title2: OutputSingle_OutputSingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("9d5af171-8c4f-45d4-bb2d-8c5577e932fc").Table("EntitySimple_TriggerOutput").Output(x => x.Single1).Output(x => x.Single2, "Single2_Destination");cn.BulkInsert("9d5af171-8c4f-45d4-bb2d-8c5577e932fc", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0053.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0053() 19 | { 20 | // Title2: OutputSingleDestination_OutputSingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("256e4bc4-b57e-4c87-8573-a6b10768d906").Table("EntitySimple_TriggerOutput").Output(x => x.Single1, "Single1_Destination").Output(x => x.Single2);cn.BulkInsert("256e4bc4-b57e-4c87-8573-a6b10768d906", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0042.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0042() 19 | { 20 | // Title2: IdentityManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("5672b926-9071-4244-8c77-441e538662cf").Table("EntitySimple_TriggerOutput").Identity(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2});cn.BulkInsert("5672b926-9071-4244-8c77-441e538662cf", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0055.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0055() 19 | { 20 | // Title2: OutputSingleDestination_OutputMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("ef59dd1f-ab17-47b7-b24d-9c02644a3b5a").Table("EntitySimple_TriggerOutput").Output(x => x.Single1, "Single1_Destination").Output(x => new { x.Many3, x.Many4});cn.BulkInsert("ef59dd1f-ab17-47b7-b24d-9c02644a3b5a", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0059.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0059() 19 | { 20 | // Title2: OutputMany_OutputSingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("2f4d7cb9-534b-4ece-b497-8e78e6fd616e").Table("EntitySimple_TriggerOutput").Output(x => new {x.Many1, x.Many2}).Output(x => x.Single2, "Single2_Destination");cn.BulkInsert("2f4d7cb9-534b-4ece-b497-8e78e6fd616e", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0029.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0029() 19 | { 20 | // Title2: IdentitySingle_IdentitySingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("2f866618-aa1e-43b7-9e5a-9aefc70af5f2").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1).Identity(x => x.Single2, "Single2_Destination");cn.BulkInsert("2f866618-aa1e-43b7-9e5a-9aefc70af5f2", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0033.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0033() 19 | { 20 | // Title2: IdentitySingleDestination_IdentitySingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("b0938b9b-1c64-431d-95cc-dca5de894a51").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1, "Single1_Destination").Identity(x => x.Single2);cn.BulkInsert("b0938b9b-1c64-431d-95cc-dca5de894a51", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0039.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0039() 19 | { 20 | // Title2: IdentityMany_IdentitySingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("8f841f7c-c555-4553-9cb6-9985db1b3eb0").Table("EntitySimple_TriggerOutput").Identity(x => new {x.Many1, x.Many2}).Identity(x => x.Single2, "Single2_Destination");cn.BulkInsert("8f841f7c-c555-4553-9cb6-9985db1b3eb0", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0035.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0035() 19 | { 20 | // Title2: IdentitySingleDestination_IdentityMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("dbd0e599-1aa4-40bb-b920-ab9f2709f24b").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1, "Single1_Destination").Identity(x => new { x.Many3, x.Many4});cn.BulkInsert("dbd0e599-1aa4-40bb-b920-ab9f2709f24b", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0063.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0063() 19 | { 20 | // Title2: OutputManyDestination_OutputSingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("6b6f7eb0-8b4b-4de6-9a3c-41069ae4d684").Table("EntitySimple_TriggerOutput").Output(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2}).Output(x => x.Single2);cn.BulkInsert("6b6f7eb0-8b4b-4de6-9a3c-41069ae4d684", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0051.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0051() 19 | { 20 | // Title2: OutputSingle_OutputManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("484712f3-3860-44c6-a250-c5f15d5aa696").Table("EntitySimple_TriggerOutput").Output(x => x.Single1).Output(x => new { Many3_Destination = x.Many3, Many4_Destination = x.Many4});cn.BulkInsert("484712f3-3860-44c6-a250-c5f15d5aa696", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3*100, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4*100, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0054.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0054() 19 | { 20 | // Title2: OutputSingleDestination_OutputSingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("1c0fb99c-c523-4cbb-9cd2-39b503aee8bd").Table("EntitySimple_TriggerOutput").Output(x => x.Single1, "Single1_Destination").Output(x => x.Single2, "Single2_Destination");cn.BulkInsert("1c0fb99c-c523-4cbb-9cd2-39b503aee8bd", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0061.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0061() 19 | { 20 | // Title2: OutputMany_OutputManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("de88c65a-e8c5-4246-bc44-1e45321ca017").Table("EntitySimple_TriggerOutput").Output(x => new {x.Many1, x.Many2}).Output(x => new { Many3_Destination = x.Many3, Many4_Destination = x.Many4});cn.BulkInsert("de88c65a-e8c5-4246-bc44-1e45321ca017", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3*100, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4*100, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0065.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0065() 19 | { 20 | // Title2: OutputManyDestination_OutputMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("182ccd49-958b-4e23-b937-e5cb1c0cda2e").Table("EntitySimple_TriggerOutput").Output(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2}).Output(x => new { x.Many3, x.Many4});cn.BulkInsert("182ccd49-958b-4e23-b937-e5cb1c0cda2e", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0031.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0031() 19 | { 20 | // Title2: IdentitySingle_IdentityManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("1f239ef8-eb67-4bee-b72d-5a2d43c275a0").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1).Identity(x => new { Many3_Destination = x.Many3, Many4_Destination = x.Many4});cn.BulkInsert("1f239ef8-eb67-4bee-b72d-5a2d43c275a0", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3*100, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4*100, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0043.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0043() 19 | { 20 | // Title2: IdentityManyDestination_IdentitySingle 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("53b88403-f827-4d50-abb9-fd16534be0d5").Table("EntitySimple_TriggerOutput").Identity(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2}).Identity(x => x.Single2);cn.BulkInsert("53b88403-f827-4d50-abb9-fd16534be0d5", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0034.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0034() 19 | { 20 | // Title2: IdentitySingleDestination_IdentitySingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("02acd990-da3c-4559-a3c9-e33ebb32acd7").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1, "Single1_Destination").Identity(x => x.Single2, "Single2_Destination");cn.BulkInsert("02acd990-da3c-4559-a3c9-e33ebb32acd7", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0041.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0041() 19 | { 20 | // Title2: IdentityMany_IdentityManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("23804ec2-fa4d-4868-9682-7b942278c464").Table("EntitySimple_TriggerOutput").Identity(x => new {x.Many1, x.Many2}).Identity(x => new { Many3_Destination = x.Many3, Many4_Destination = x.Many4});cn.BulkInsert("23804ec2-fa4d-4868-9682-7b942278c464", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3*100, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4*100, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0045.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0045() 19 | { 20 | // Title2: IdentityManyDestination_IdentityMany 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("6c3d65ce-bcbc-4f75-b542-2a8a9c594eaf").Table("EntitySimple_TriggerOutput").Identity(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2}).Identity(x => new { x.Many3, x.Many4});cn.BulkInsert("6c3d65ce-bcbc-4f75-b542-2a8a9c594eaf", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0056.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0056() 19 | { 20 | // Title2: OutputSingleDestination_OutputManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("4747b1bd-fe0b-4f3b-86b6-b8e230764055").Table("EntitySimple_TriggerOutput").Output(x => x.Single1, "Single1_Destination").Output(x => new { Many3_Destination = x.Many3, Many4_Destination = x.Many4});cn.BulkInsert("4747b1bd-fe0b-4f3b-86b6-b8e230764055", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3*100, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4*100, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/OutputMapper_OutputMapper/0064.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_OutputMapper_OutputMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0064() 19 | { 20 | // Title2: OutputManyDestination_OutputSingleDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("db9dd12b-2432-4507-9a12-d66081a1db6f").Table("EntitySimple_TriggerOutput").Output(x => new {Many1_Destination = x.Many1, Many2_Destination = x.Many2}).Output(x => x.Single2, "Single2_Destination");cn.BulkInsert("db9dd12b-2432-4507-9a12-d66081a1db6f", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(singleBefore.Single1, single.Single1); 97 | Assert.AreEqual(-singleBefore.Single2*100, single.Single2); 98 | Assert.AreEqual(-singleBefore.Many1*100, single.Many1); 99 | Assert.AreEqual(-singleBefore.Many2*100, single.Many2); 100 | Assert.AreEqual(singleBefore.Many3, single.Many3); 101 | Assert.AreEqual(singleBefore.Many4, single.Many4); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /src/test/Z.Test/Mapper/IdentityMapper_IdentityMapper/0036.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; 11 | using Z.Dapper.Plus; 12 | 13 | namespace Z.Test 14 | { 15 | public partial class Mapper_IdentityMapper_IdentityMapper 16 | { 17 | [TestMethod] 18 | public void Z_Test_0036() 19 | { 20 | // Title2: IdentitySingleDestination_IdentityManyDestination 21 | 22 | Helper.CleanDatabase(); 23 | 24 | var singleBefore = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 25 | var single = new EntitySimple_Mapper { Single1 = 1, Single2 = 2, Many1 = 10, Many2 = 20, Many3 = 30, Many4 = 40}; 26 | 27 | using (var cn = Helper.GetConnection()) 28 | { 29 | cn.Open(); 30 | 31 | // PreTest 32 | 33 | // Action 34 | DapperPlusManager.Entity("f4183c7f-3ee8-4b34-890b-3e26fb938b88").Table("EntitySimple_TriggerOutput").Identity(x => x.Single1, "Single1_Destination").Identity(x => new { Many3_Destination = x.Many3, Many4_Destination = x.Many4});cn.BulkInsert("f4183c7f-3ee8-4b34-890b-3e26fb938b88", single); 35 | } 36 | 37 | // GET count 38 | int single1 = 0; 39 | int single2 = 0; 40 | int many1 = 0; 41 | int many2 = 0; 42 | int many3 = 0; 43 | int many4 = 0; 44 | 45 | int single1_Destination = 0; 46 | int single2_Destination = 0; 47 | int many1_Destination = 0; 48 | int many2_Destination = 0; 49 | int many3_Destination = 0; 50 | int many4_Destination = 0; 51 | 52 | using (var connection = Helper.GetConnection()) 53 | { 54 | connection.Open(); 55 | 56 | using (var command = connection.CreateCommand()) 57 | { 58 | 59 | command.CommandText = @" 60 | SELECT TOP 1 61 | [Single1] , 62 | [Single2] , 63 | [Many1] , 64 | [Many2] , 65 | [Many3] , 66 | [Many4] , 67 | [Single1_Destination] , 68 | [Single2_Destination] , 69 | [Many1_Destination] , 70 | [Many2_Destination] , 71 | [Many3_Destination] , 72 | [Many4_Destination] " + 73 | "FROM [Z.Dapper.Plus].[dbo].[EntitySimple_TriggerOutput]"; 74 | 75 | using (var reader = command.ExecuteReader()) 76 | { 77 | reader.Read(); 78 | single1 = reader.IsDBNull(0) ? 0 : reader.GetInt32(0); 79 | single2 = reader.IsDBNull(1) ? 0 : reader.GetInt32(1); 80 | many1 = reader.IsDBNull(2) ? 0 : reader.GetInt32(2); 81 | many2 = reader.IsDBNull(3) ? 0 : reader.GetInt32(3); 82 | many3 = reader.IsDBNull(4) ? 0 : reader.GetInt32(4); 83 | many4 = reader.IsDBNull(5) ? 0 : reader.GetInt32(5); 84 | 85 | single1_Destination = reader.IsDBNull(6) ? 0 : reader.GetInt32(6); 86 | single2_Destination = reader.IsDBNull(7) ? 0 : reader.GetInt32(7); 87 | many1_Destination = reader.IsDBNull(8) ? 0 : reader.GetInt32(8); 88 | many2_Destination = reader.IsDBNull(9) ? 0 : reader.GetInt32(9); 89 | many3_Destination = reader.IsDBNull(10) ? 0 : reader.GetInt32(10); 90 | many4_Destination = reader.IsDBNull(11) ? 0 : reader.GetInt32(11); 91 | } 92 | } 93 | } 94 | 95 | // Test 96 | Assert.AreEqual(-singleBefore.Single1*100, single.Single1); 97 | Assert.AreEqual(singleBefore.Single2, single.Single2); 98 | Assert.AreEqual(singleBefore.Many1, single.Many1); 99 | Assert.AreEqual(singleBefore.Many2, single.Many2); 100 | Assert.AreEqual(-singleBefore.Many3*100, single.Many3); 101 | Assert.AreEqual(-singleBefore.Many4*100, single.Many4); 102 | } 103 | } 104 | } --------------------------------------------------------------------------------