├── .gitattributes ├── .gitignore ├── README.md ├── dapper-net-sample.sln ├── dapper-net-sample ├── Contrib_Insert_One_Entity.cs ├── Contrib_Select_One_Entity.cs ├── Contrib_SqlBuilder.cs ├── Contrib_Update_Entity_Using_Tracking.cs ├── Contrib_Update_One_Entity.cs ├── Core_Insert_One_Entity_Using_Raw_Sql.cs ├── Core_Insert_One_Entity_Using_Sql_Extension.cs ├── Core_Select_All_Entities.cs ├── Core_Select_By_Dynamic.cs ├── Core_Select_Multiple_Items.cs ├── Core_Select_Multiple_Items_With_One_Reference.cs ├── Core_Select_One_Item.cs ├── Core_Select_One_Item_With_Collection_Reference.cs ├── Core_Update_Item.cs ├── DapperContrib │ ├── SqlBuilder.cs │ └── SqlMapperExtensions.cs ├── Entity │ ├── Product.cs │ └── Supplier.cs ├── Properties │ └── AssemblyInfo.cs ├── Rainbow_Insert_New_Entity.cs ├── Rainbow_Select_All_Entities.cs ├── Rainbow_Update_One_Entity.cs ├── Utility │ ├── Constant.cs │ ├── ObjectDumper.cs │ ├── ProgramSelector.cs │ └── StackOverflowExtension.cs ├── app.config ├── dapper-net-sample.csproj └── packages.config ├── database └── Northwind.sql ├── doc └── note.txt └── packages ├── AnglicanGeek.DbExecutor.0.1.2 ├── AnglicanGeek.DbExecutor.0.1.2.nupkg └── lib │ └── net40 │ └── AnglicanGeek.DbExecutor.dll ├── CavemanTools.1.4.0.40894 ├── CavemanTools.1.4.0.40894.nupkg └── lib │ └── net40 │ ├── CavemanTools.XML │ └── CavemanTools.dll ├── Dapper.1.9 ├── Dapper.1.9.nupkg └── lib │ ├── net35 │ └── Dapper.dll │ └── net40 │ └── Dapper.dll ├── Dapper.Rainbow.0.1.2 ├── Dapper.Rainbow.0.1.2.nupkg └── lib │ └── net40 │ └── Dapper.Rainbow.dll ├── Dapper.Rainbow.SQLite.0.1.2 ├── Dapper.Rainbow.SQLite.0.1.2.nupkg └── lib │ └── net40 │ └── Dapper.Rainbow.SQLite.dll ├── DapperExtensions.1.3.1 ├── DapperExtensions.1.3.1.nupkg └── lib │ └── net40 │ └── DapperExtensions.dll ├── DapperExtensions.1.3.2 ├── DapperExtensions.1.3.2.nupkg └── lib │ └── net40 │ └── DapperExtensions.dll ├── DapperWrapper.0.3.0.0 ├── DapperWrapper.0.3.0.0.nupkg └── lib │ └── net40 │ └── DapperWrapper.dll ├── HalfOgre.DbExecutor.0.2.0.0 ├── HalfOgre.DbExecutor.0.2.0.0.nupkg └── lib │ └── net40 │ └── DbExecutor.dll ├── Lithium.1.4.2 ├── Lithium.1.4.2.nupkg └── lib │ └── net40 │ └── Lithium.dll ├── ObjectDumper.1.0.0.12 ├── ObjectDumper.1.0.0.12.nupkg └── lib │ └── net35-Client │ └── ObjectDumper.dll ├── SQLinq.2.0 ├── SQLinq.2.0.nupkg └── lib │ └── net │ └── SQLinq.dll ├── SQLinq.Dapper.1.2 ├── SQLinq.Dapper.1.2.nupkg └── lib │ └── net │ └── SQLinq.Dapper.dll ├── SqlFu.1.0.3 ├── SqlFu.1.0.3.nupkg └── lib │ └── Net40 │ ├── SqlFu.XML │ └── SqlFu.dll ├── jot.skeet.miscutil └── MiscUtil.dll └── repositories.config /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | dapper-net-sample 2 | ================= 3 | 4 | Sample project using Dapper.net. You can check the my blog from: http://http://liangwu.wordpress.com/ 5 | -------------------------------------------------------------------------------- /dapper-net-sample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dapper-net-sample", "dapper-net-sample\dapper-net-sample.csproj", "{F593A5A9-BC26-4D54-9688-9B2E8EB13962}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {F593A5A9-BC26-4D54-9688-9B2E8EB13962}.Debug|x86.ActiveCfg = Debug|x86 13 | {F593A5A9-BC26-4D54-9688-9B2E8EB13962}.Debug|x86.Build.0 = Debug|x86 14 | {F593A5A9-BC26-4D54-9688-9B2E8EB13962}.Release|x86.ActiveCfg = Release|x86 15 | {F593A5A9-BC26-4D54-9688-9B2E8EB13962}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /dapper-net-sample/Contrib_Insert_One_Entity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper.Contrib.Extensions; 5 | using dapper_net_sample.Entity; 6 | using dapper_net_sample.Utility; 7 | 8 | namespace dapper_net_sample 9 | { 10 | public class Contrib_Insert_One_Entity 11 | { 12 | public static void Main() 13 | { 14 | using (var sqlConnection 15 | = new SqlConnection(Constant.DatabaseConnection)) 16 | { 17 | sqlConnection.Open(); 18 | 19 | var supplier = new Supplier() 20 | { 21 | Address = "10 Main Street", 22 | CompanyName = "ABC Corporation" 23 | }; 24 | 25 | var supplierId = sqlConnection.Insert(supplier); 26 | 27 | sqlConnection.Close(); 28 | 29 | Console.WriteLine(string.Format("New Supplier Id is {0}", supplierId)); 30 | 31 | Console.WriteLine("Done. "); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /dapper-net-sample/Contrib_Select_One_Entity.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using Dapper.Contrib.Extensions; 3 | using dapper_net_sample.Entity; 4 | using dapper_net_sample.Utility; 5 | 6 | namespace dapper_net_sample 7 | { 8 | public class Contrib_Select_One_Entity 9 | { 10 | public static void Main() 11 | { 12 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 13 | { 14 | sqlConnection.Open(); 15 | 16 | var result = sqlConnection.Get(9); 17 | 18 | ObjectDumper.Write(result); 19 | } 20 | } 21 | 22 | } 23 | } -------------------------------------------------------------------------------- /dapper-net-sample/Contrib_SqlBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using Dapper; 3 | using dapper_net_sample.Utility; 4 | 5 | namespace dapper_net_sample 6 | { 7 | class Contrib_SqlBuilder 8 | { 9 | public static void Main() 10 | { 11 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 12 | { 13 | sqlConnection.Open(); 14 | var builder = new SqlBuilder(); 15 | 16 | // /**select**/ -- has to be low case 17 | var selectSupplierIdBuilder = builder.AddTemplate("Select /**select**/ from Suppliers /**where**/ "); 18 | builder.Select("Id"); 19 | builder.Where("City = @City", new { City = "Tokyo"}); // pass an anonymous object 20 | 21 | var supplierIds = sqlConnection.Query(selectSupplierIdBuilder.RawSql, 22 | selectSupplierIdBuilder.Parameters); 23 | 24 | ObjectDumper.Write(supplierIds); 25 | 26 | sqlConnection.Close(); 27 | 28 | } 29 | 30 | 31 | 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /dapper-net-sample/Contrib_Update_Entity_Using_Tracking.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using Dapper.Contrib.Extensions; 3 | using dapper_net_sample.Entity; 4 | using dapper_net_sample.Utility; 5 | 6 | namespace dapper_net_sample 7 | { 8 | public class Contrib_Update_Entity_Using_Tracking 9 | { 10 | public static void Main() 11 | { 12 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 13 | { 14 | sqlConnection.Open(); 15 | 16 | // using interface to track "Isdirty" 17 | var supplier = sqlConnection.Get(9); 18 | //supplier.CompanyName = "Manning"; 19 | 20 | // should return false, becasue there is no change. 21 | ObjectDumper.Write(string.Format("Is Update {0}", sqlConnection.Update(supplier))); 22 | 23 | supplier.CompanyName = "Manning"; 24 | 25 | // should return true 26 | ObjectDumper.Write(string.Format("Is Update {0}", sqlConnection.Update(supplier))); 27 | 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /dapper-net-sample/Contrib_Update_One_Entity.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using Dapper.Contrib; 3 | using Dapper.Contrib.Extensions; 4 | using dapper_net_sample.Entity; 5 | using dapper_net_sample.Utility; 6 | 7 | namespace dapper_net_sample 8 | { 9 | public class Contrib_Update_One_Entity 10 | { 11 | public static void Main() 12 | { 13 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 14 | { 15 | sqlConnection.Open(); 16 | 17 | var entity = sqlConnection.Get(9); 18 | entity.ContactName = "John Smith"; 19 | 20 | sqlConnection.Update(entity); 21 | 22 | var result = sqlConnection.Get(9); 23 | 24 | ObjectDumper.Write(result.ContactName); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Insert_One_Entity_Using_Raw_Sql.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using System.Linq; 5 | using Dapper; 6 | using dapper_net_sample.Entity; 7 | using dapper_net_sample.Utility; 8 | 9 | namespace dapper_net_sample 10 | { 11 | /// 12 | /// Insert object using default dapper implementation 13 | /// 14 | public class Core_Insert_One_Entity_Using_Raw_Sql 15 | { 16 | public static void Main() 17 | { 18 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 19 | { 20 | sqlConnection.Open(); 21 | 22 | var supplier = new Supplier() 23 | { 24 | Address = "10 Main Street", 25 | CompanyName = "ABC Corporation" 26 | }; 27 | 28 | supplier.Id = sqlConnection.Query( 29 | @" 30 | insert Suppliers(CompanyName, Address) 31 | values (@CompanyName, @Address) 32 | select cast(scope_identity() as int) 33 | ", supplier).First(); 34 | 35 | 36 | 37 | sqlConnection.Close(); 38 | 39 | Console.WriteLine(supplier.Id); 40 | 41 | Console.WriteLine("Done. "); 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Insert_One_Entity_Using_Sql_Extension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Entity; 6 | using dapper_net_sample.Utility; 7 | 8 | namespace dapper_net_sample 9 | { 10 | public class Core_Insert_One_Entity_Using_Sql_Extension 11 | { 12 | public static void Main() 13 | { 14 | using (var sqlConnection 15 | = new SqlConnection(Constant.DatabaseConnection)) 16 | { 17 | sqlConnection.Open(); 18 | 19 | var supplier = new Supplier() 20 | { 21 | Address = "10 Main Street", 22 | CompanyName = "DEF Corporation" 23 | }; 24 | 25 | sqlConnection.Execute( 26 | @" 27 | insert Suppliers(CompanyName, Address) 28 | values (@CompanyName, @Address) 29 | ", 30 | supplier); 31 | 32 | sqlConnection.Close(); 33 | 34 | Console.WriteLine("Done. "); 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Select_All_Entities.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Entity; 6 | using dapper_net_sample.Utility; 7 | 8 | namespace dapper_net_sample 9 | { 10 | internal class Core_Select_All_Entities 11 | { 12 | public static void Main() 13 | { 14 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 15 | { 16 | sqlConnection.Open(); 17 | IEnumerable products = 18 | sqlConnection.Query("Select * from Products"); 19 | 20 | foreach (Product product in products) 21 | { 22 | ObjectDumper.Write(product); 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Select_By_Dynamic.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Utility; 6 | 7 | namespace dapper_net_sample 8 | { 9 | public class Core_Select_By_Dynamic 10 | { 11 | public static void Main() 12 | { 13 | string connectionString = ConfigurationManager.ConnectionStrings["database-connection-2"].ConnectionString; 14 | 15 | using (var sqlConnection 16 | = new SqlConnection(connectionString)) 17 | { 18 | sqlConnection.Open(); 19 | IEnumerable products = sqlConnection 20 | .Query("Select * from Products where Id = @Id", 21 | new {Id = 2}); 22 | 23 | foreach (dynamic product in products) 24 | { 25 | 26 | ObjectDumper.Write(string.Format("{0}-{1}", product.Id, product.ProductName)); 27 | } 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Select_Multiple_Items.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.SqlClient; 3 | using System.Linq; 4 | using dapper_net_sample.Entity; 5 | using dapper_net_sample.Utility; 6 | using Dapper; 7 | using dapper_net_sample.Extension; 8 | 9 | namespace dapper_net_sample 10 | { 11 | public class Core_Select_Multiple_Items 12 | { 13 | public static void Main() 14 | { 15 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 16 | { 17 | sqlConnection.Open(); 18 | 19 | var query = @" 20 | SELECT * FROM dbo.Suppliers WHERE Id = @Id 21 | 22 | SELECT * FROM dbo.Products WHERE SupplierID = @Id 23 | 24 | "; 25 | 26 | // return a GridReader 27 | using (var result = sqlConnection.QueryMultiple(query, new {Id = 1})) 28 | { 29 | var supplier = result.Read().Single(); 30 | var products = result.Read().ToList(); 31 | 32 | ObjectDumper.Write(supplier); 33 | 34 | Console.WriteLine(string.Format("Total Products {0}", products.Count)); 35 | 36 | ObjectDumper.Write(products); 37 | } 38 | 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Select_Multiple_Items_With_One_Reference.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Entity; 6 | using dapper_net_sample.Utility; 7 | 8 | namespace dapper_net_sample 9 | { 10 | /// 11 | /// Select one entity object with children collection 12 | /// 13 | public class Core_Select_Multiple_Items_With_One_Reference 14 | { 15 | public static void Main() 16 | { 17 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 18 | { 19 | sqlConnection.Open(); 20 | 21 | IEnumerable products = sqlConnection 22 | .Query( 23 | @"select Products.*, Suppliers.* 24 | from Products join Suppliers 25 | on Products.SupplierId = Suppliers.Id 26 | and suppliers.Id = 2", 27 | (a, s) => 28 | { 29 | a.Supplier = s; 30 | return a; 31 | }); // use splitOn, if the id field is not Id or ID 32 | 33 | foreach (Product product in products) 34 | { 35 | ObjectDumper.Write(product.Supplier); 36 | } 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Select_One_Item.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Entity; 6 | using dapper_net_sample.Utility; 7 | 8 | namespace dapper_net_sample 9 | { 10 | /// 11 | /// Select entity object by Id 12 | /// 13 | public class Core_Select_One_Item 14 | { 15 | public static void Main() 16 | { 17 | using (var sqlConnection 18 | = new SqlConnection(Constant.DatabaseConnection)) 19 | { 20 | sqlConnection.Open(); 21 | IEnumerable products = sqlConnection 22 | .Query("Select * from Products where Id = @ProductId", 23 | new {ProductID = 2}); 24 | 25 | foreach (Product product in products) 26 | { 27 | ObjectDumper.Write(product); 28 | } 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Select_One_Item_With_Collection_Reference.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data.SqlClient; 5 | using System.Linq; 6 | using Dapper; 7 | using dapper_net_sample.Entity; 8 | using dapper_net_sample.Extension; 9 | using dapper_net_sample.Utility; 10 | 11 | namespace dapper_net_sample 12 | { 13 | /// 14 | /// query one to many items 15 | /// 16 | public class Core_Select_One_Item_With_Collection_Reference 17 | { 18 | public static void Main() 19 | { 20 | var suppliers = QuerySupplier(); 21 | 22 | foreach (var supplier in suppliers) 23 | { 24 | var products = supplier.Products.ToList(); 25 | 26 | Console.WriteLine(products.Count); 27 | } 28 | } 29 | 30 | private static IEnumerable QuerySupplier() 31 | { 32 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 33 | { 34 | sqlConnection.Open(); 35 | 36 | var query = 37 | @" 38 | SELECT * FROM dbo.Suppliers WHERE ContactName = 'Charlotte Cooper' 39 | 40 | SELECT * FROM dbo.Products WHERE SupplierID IN (SELECT Id FROM dbo.Suppliers WHERE ContactName = 'Charlotte Cooper') 41 | "; 42 | 43 | return sqlConnection 44 | .QueryMultiple(query).Map(supplier => supplier.Id, 45 | product => product.SupplierID, 46 | (supplier, products) => { supplier.Products = products; }); 47 | } 48 | 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /dapper-net-sample/Core_Update_Item.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using Dapper; 3 | using dapper_net_sample.Utility; 4 | 5 | namespace dapper_net_sample 6 | { 7 | public class Core_Update_Item 8 | { 9 | public static void Main() 10 | { 11 | using (var sqlConnection = new SqlConnection(Constant.DatabaseConnection)) 12 | { 13 | sqlConnection.Open(); 14 | 15 | var updateStatement = @"Update Products Set UnitPrice = @UnitPrice 16 | Where Id = @ProductId 17 | "; 18 | 19 | sqlConnection.Execute(updateStatement, new 20 | { 21 | UnitPrice = 100.0m, 22 | ProductId = 50 23 | }); 24 | sqlConnection.Close(); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /dapper-net-sample/DapperContrib/SqlBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Dapper 7 | { 8 | public class SqlBuilder 9 | { 10 | Dictionary data = new Dictionary(); 11 | int seq; 12 | 13 | class Clause 14 | { 15 | public string Sql { get; set; } 16 | public object Parameters { get; set; } 17 | } 18 | 19 | class Clauses : List 20 | { 21 | string joiner; 22 | string prefix; 23 | string postfix; 24 | 25 | public Clauses(string joiner, string prefix = "", string postfix = "") 26 | { 27 | this.joiner = joiner; 28 | this.prefix = prefix; 29 | this.postfix = postfix; 30 | } 31 | 32 | public string ResolveClauses(DynamicParameters p) 33 | { 34 | foreach (var item in this) 35 | { 36 | p.AddDynamicParams(item.Parameters); 37 | } 38 | return prefix + string.Join(joiner, this.Select(c => c.Sql)) + postfix; 39 | } 40 | } 41 | 42 | public class Template 43 | { 44 | readonly string sql; 45 | readonly SqlBuilder builder; 46 | readonly object initParams; 47 | int dataSeq = -1; // Unresolved 48 | 49 | public Template(SqlBuilder builder, string sql, dynamic parameters) 50 | { 51 | this.initParams = parameters; 52 | this.sql = sql; 53 | this.builder = builder; 54 | } 55 | 56 | static System.Text.RegularExpressions.Regex regex = 57 | new System.Text.RegularExpressions.Regex(@"\/\*\*.+\*\*\/", System.Text.RegularExpressions.RegexOptions.Compiled | System.Text.RegularExpressions.RegexOptions.Multiline); 58 | 59 | void ResolveSql() 60 | { 61 | if (dataSeq != builder.seq) 62 | { 63 | DynamicParameters p = new DynamicParameters(initParams); 64 | 65 | rawSql = sql; 66 | 67 | foreach (var pair in builder.data) 68 | { 69 | rawSql = rawSql.Replace("/**" + pair.Key + "**/", pair.Value.ResolveClauses(p)); 70 | } 71 | parameters = p; 72 | 73 | // replace all that is left with empty 74 | rawSql = regex.Replace(rawSql, ""); 75 | 76 | dataSeq = builder.seq; 77 | } 78 | } 79 | 80 | string rawSql; 81 | object parameters; 82 | 83 | public string RawSql { get { ResolveSql(); return rawSql; } } 84 | public object Parameters { get { ResolveSql(); return parameters; } } 85 | } 86 | 87 | 88 | public SqlBuilder() 89 | { 90 | } 91 | 92 | public Template AddTemplate(string sql, dynamic parameters = null) 93 | { 94 | return new Template(this, sql, parameters); 95 | } 96 | 97 | void AddClause(string name, string sql, object parameters, string joiner, string prefix = "", string postfix = "") 98 | { 99 | Clauses clauses; 100 | if (!data.TryGetValue(name, out clauses)) 101 | { 102 | clauses = new Clauses(joiner, prefix, postfix); 103 | data[name] = clauses; 104 | } 105 | clauses.Add(new Clause { Sql = sql, Parameters = parameters }); 106 | seq++; 107 | } 108 | 109 | public SqlBuilder InnerJoin(string sql, dynamic parameters = null) 110 | { 111 | AddClause("innerjoin", sql, parameters, joiner: "\nINNER JOIN ", prefix: "\nINNER JOIN ", postfix: "\n"); 112 | return this; 113 | } 114 | 115 | public SqlBuilder LeftJoin(string sql, dynamic parameters = null) 116 | { 117 | AddClause("leftjoin", sql, parameters, joiner: "\nLEFT JOIN ", prefix: "\nLEFT JOIN ", postfix: "\n"); 118 | return this; 119 | } 120 | 121 | public SqlBuilder RightJoin(string sql, dynamic parameters = null) 122 | { 123 | AddClause("rightjoin", sql, parameters, joiner: "\nRIGHT JOIN ", prefix: "\nRIGHT JOIN ", postfix: "\n"); 124 | return this; 125 | } 126 | 127 | public SqlBuilder Where(string sql, dynamic parameters = null) 128 | { 129 | AddClause("where", sql, parameters, " AND ", prefix: "WHERE ", postfix: "\n"); 130 | return this; 131 | } 132 | 133 | public SqlBuilder OrderBy(string sql, dynamic parameters = null) 134 | { 135 | AddClause("orderby", sql, parameters, " , ", prefix: "ORDER BY ", postfix: "\n"); 136 | return this; 137 | } 138 | 139 | public SqlBuilder Select(string sql, dynamic parameters = null) 140 | { 141 | AddClause("select", sql, parameters, " , ", prefix: "", postfix: "\n"); 142 | return this; 143 | } 144 | 145 | public SqlBuilder AddParameters(dynamic parameters) 146 | { 147 | AddClause("--parameters", "", parameters, ""); 148 | return this; 149 | } 150 | 151 | public SqlBuilder Join(string sql, dynamic parameters = null) 152 | { 153 | AddClause("join", sql, parameters, joiner: "\nJOIN ", prefix: "\nJOIN ", postfix: "\n"); 154 | return this; 155 | } 156 | 157 | public SqlBuilder GroupBy(string sql, dynamic parameters = null) 158 | { 159 | AddClause("groupby", sql, parameters, joiner: " , ", prefix: "\nGROUP BY ", postfix: "\n"); 160 | return this; 161 | } 162 | 163 | public SqlBuilder Having(string sql, dynamic parameters = null) 164 | { 165 | AddClause("having", sql, parameters, joiner: "\nAND ", prefix: "HAVING ", postfix: "\n"); 166 | return this; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /dapper-net-sample/DapperContrib/SqlMapperExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Collections.Concurrent; 8 | using System.Reflection.Emit; 9 | using System.Threading; 10 | using Dapper; 11 | 12 | namespace Dapper.Contrib.Extensions 13 | { 14 | 15 | public static class SqlMapperExtensions 16 | { 17 | public interface IProxy 18 | { 19 | bool IsDirty { get; set; } 20 | } 21 | 22 | private static readonly ConcurrentDictionary> KeyProperties = new ConcurrentDictionary>(); 23 | private static readonly ConcurrentDictionary> TypeProperties = new ConcurrentDictionary>(); 24 | private static readonly ConcurrentDictionary GetQueries = new ConcurrentDictionary(); 25 | private static readonly ConcurrentDictionary TypeTableName = new ConcurrentDictionary(); 26 | 27 | private static readonly Dictionary AdapterDictionary = new Dictionary() { 28 | {"sqlconnection", new SqlServerAdapter()}, 29 | {"npgsqlconnection", new PostgresAdapter()} 30 | }; 31 | 32 | private static IEnumerable KeyPropertiesCache(Type type) 33 | { 34 | 35 | IEnumerable pi; 36 | if (KeyProperties.TryGetValue(type.TypeHandle,out pi)) 37 | { 38 | return pi; 39 | } 40 | 41 | var allProperties = TypePropertiesCache(type); 42 | var keyProperties = allProperties.Where(p => p.GetCustomAttributes(true).Any(a => a is KeyAttribute)).ToList(); 43 | 44 | if (keyProperties.Count == 0) 45 | { 46 | var idProp = allProperties.Where(p => p.Name.ToLower() == "id").FirstOrDefault(); 47 | if (idProp != null) 48 | { 49 | keyProperties.Add(idProp); 50 | } 51 | } 52 | 53 | KeyProperties[type.TypeHandle] = keyProperties; 54 | return keyProperties; 55 | } 56 | private static IEnumerable TypePropertiesCache(Type type) 57 | { 58 | IEnumerable pis; 59 | if (TypeProperties.TryGetValue(type.TypeHandle, out pis)) 60 | { 61 | return pis; 62 | } 63 | 64 | var properties = type.GetProperties().Where(IsWriteable); 65 | TypeProperties[type.TypeHandle] = properties; 66 | return properties; 67 | } 68 | 69 | public static bool IsWriteable(PropertyInfo pi) 70 | { 71 | object[] attributes = pi.GetCustomAttributes(typeof (WriteAttribute), false); 72 | if (attributes.Length == 1) 73 | { 74 | WriteAttribute write = (WriteAttribute) attributes[0]; 75 | return write.Write; 76 | } 77 | return true; 78 | } 79 | 80 | /// 81 | /// Returns a single entity by a single id from table "Ts". T must be of interface type. 82 | /// Id must be marked with [Key] attribute. 83 | /// Created entity is tracked/intercepted for changes and used by the Update() extension. 84 | /// 85 | /// Interface type to create and populate 86 | /// Open SqlConnection 87 | /// Id of the entity to get, must be marked with [Key] attribute 88 | /// Entity of T 89 | public static T Get(this IDbConnection connection, dynamic id, IDbTransaction transaction = null, int? commandTimeout = null) where T : class 90 | { 91 | var type = typeof(T); 92 | string sql; 93 | if (!GetQueries.TryGetValue(type.TypeHandle, out sql)) 94 | { 95 | var keys = KeyPropertiesCache(type); 96 | if (keys.Count() > 1) 97 | throw new DataException("Get only supports an entity with a single [Key] property"); 98 | if (keys.Count() == 0) 99 | throw new DataException("Get only supports en entity with a [Key] property"); 100 | 101 | var onlyKey = keys.First(); 102 | 103 | var name = GetTableName(type); 104 | 105 | // TODO: pluralizer 106 | // TODO: query information schema and only select fields that are both in information schema and underlying class / interface 107 | sql = "select * from " + name + " where " + onlyKey.Name + " = @id"; 108 | GetQueries[type.TypeHandle] = sql; 109 | } 110 | 111 | var dynParms = new DynamicParameters(); 112 | dynParms.Add("@id", id); 113 | 114 | T obj = null; 115 | 116 | if (type.IsInterface) 117 | { 118 | var res = connection.Query(sql, dynParms).FirstOrDefault() as IDictionary; 119 | 120 | if (res == null) 121 | return (T)((object)null); 122 | 123 | obj = ProxyGenerator.GetInterfaceProxy(); 124 | 125 | foreach (var property in TypePropertiesCache(type)) 126 | { 127 | var val = res[property.Name]; 128 | property.SetValue(obj, val, null); 129 | } 130 | 131 | ((IProxy)obj).IsDirty = false; //reset change tracking and return 132 | } 133 | else 134 | { 135 | obj = connection.Query(sql, dynParms, transaction: transaction, commandTimeout: commandTimeout).FirstOrDefault(); 136 | } 137 | return obj; 138 | } 139 | 140 | private static string GetTableName(Type type) 141 | { 142 | string name; 143 | if (!TypeTableName.TryGetValue(type.TypeHandle, out name)) 144 | { 145 | name = type.Name + "s"; 146 | if (type.IsInterface && name.StartsWith("I")) 147 | name = name.Substring(1); 148 | 149 | //NOTE: This as dynamic trick should be able to handle both our own Table-attribute as well as the one in EntityFramework 150 | var tableattr = type.GetCustomAttributes(false).Where(attr => attr.GetType().Name == "TableAttribute").SingleOrDefault() as 151 | dynamic; 152 | if (tableattr != null) 153 | name = tableattr.Name; 154 | TypeTableName[type.TypeHandle] = name; 155 | } 156 | return name; 157 | } 158 | 159 | /// 160 | /// Inserts an entity into table "Ts" and returns identity id. 161 | /// 162 | /// Open SqlConnection 163 | /// Entity to insert 164 | /// Identity of inserted entity 165 | public static long Insert(this IDbConnection connection, T entityToInsert, IDbTransaction transaction = null, int? commandTimeout = null) where T : class 166 | { 167 | 168 | var type = typeof(T); 169 | 170 | var name = GetTableName(type); 171 | 172 | var sbColumnList = new StringBuilder(null); 173 | 174 | var allProperties = TypePropertiesCache(type); 175 | var keyProperties = KeyPropertiesCache(type); 176 | var allPropertiesExceptKey = allProperties.Except(keyProperties); 177 | 178 | for (var i = 0; i < allPropertiesExceptKey.Count(); i++) 179 | { 180 | var property = allPropertiesExceptKey.ElementAt(i); 181 | sbColumnList.Append(property.Name); 182 | if (i < allPropertiesExceptKey.Count() - 1) 183 | sbColumnList.Append(", "); 184 | } 185 | 186 | var sbParameterList = new StringBuilder(null); 187 | for (var i = 0; i < allPropertiesExceptKey.Count(); i++) 188 | { 189 | var property = allPropertiesExceptKey.ElementAt(i); 190 | sbParameterList.AppendFormat("@{0}", property.Name); 191 | if (i < allPropertiesExceptKey.Count() - 1) 192 | sbParameterList.Append(", "); 193 | } 194 | ISqlAdapter adapter = GetFormatter(connection); 195 | int id = adapter.Insert(connection, transaction, commandTimeout, name, sbColumnList.ToString(), sbParameterList.ToString(), keyProperties, entityToInsert); 196 | return id; 197 | } 198 | 199 | /// 200 | /// Updates entity in table "Ts", checks if the entity is modified if the entity is tracked by the Get() extension. 201 | /// 202 | /// Type to be updated 203 | /// Open SqlConnection 204 | /// Entity to be updated 205 | /// true if updated, false if not found or not modified (tracked entities) 206 | public static bool Update(this IDbConnection connection, T entityToUpdate, IDbTransaction transaction = null, int? commandTimeout = null) where T : class 207 | { 208 | var proxy = entityToUpdate as IProxy; 209 | if (proxy != null) 210 | { 211 | if (!proxy.IsDirty) return false; 212 | } 213 | 214 | var type = typeof(T); 215 | 216 | var keyProperties = KeyPropertiesCache(type); 217 | if (!keyProperties.Any()) 218 | throw new ArgumentException("Entity must have at least one [Key] property"); 219 | 220 | var name = GetTableName(type); 221 | 222 | var sb = new StringBuilder(); 223 | sb.AppendFormat("update {0} set ", name); 224 | 225 | var allProperties = TypePropertiesCache(type); 226 | var nonIdProps = allProperties.Where(a => !keyProperties.Contains(a)); 227 | 228 | for (var i = 0; i < nonIdProps.Count(); i++) 229 | { 230 | var property = nonIdProps.ElementAt(i); 231 | sb.AppendFormat("{0} = @{1}", property.Name, property.Name); 232 | if (i < nonIdProps.Count() - 1) 233 | sb.AppendFormat(", "); 234 | } 235 | sb.Append(" where "); 236 | for (var i = 0; i < keyProperties.Count(); i++) 237 | { 238 | var property = keyProperties.ElementAt(i); 239 | sb.AppendFormat("{0} = @{1}", property.Name, property.Name); 240 | if (i < keyProperties.Count() - 1) 241 | sb.AppendFormat(" and "); 242 | } 243 | var updated = connection.Execute(sb.ToString(), entityToUpdate, commandTimeout: commandTimeout, transaction: transaction); 244 | return updated > 0; 245 | } 246 | 247 | /// 248 | /// Delete entity in table "Ts". 249 | /// 250 | /// Type of entity 251 | /// Open SqlConnection 252 | /// Entity to delete 253 | /// true if deleted, false if not found 254 | public static bool Delete(this IDbConnection connection, T entityToDelete, IDbTransaction transaction = null, int? commandTimeout = null) where T : class 255 | { 256 | if (entityToDelete == null) 257 | throw new ArgumentException("Cannot Delete null Object", "entityToDelete"); 258 | 259 | var type = typeof(T); 260 | 261 | var keyProperties = KeyPropertiesCache(type); 262 | if (keyProperties.Count() == 0) 263 | throw new ArgumentException("Entity must have at least one [Key] property"); 264 | 265 | var name = GetTableName(type); 266 | 267 | var sb = new StringBuilder(); 268 | sb.AppendFormat("delete from {0} where ", name); 269 | 270 | for (var i = 0; i < keyProperties.Count(); i++) 271 | { 272 | var property = keyProperties.ElementAt(i); 273 | sb.AppendFormat("{0} = @{1}", property.Name, property.Name); 274 | if (i < keyProperties.Count() - 1) 275 | sb.AppendFormat(" and "); 276 | } 277 | var deleted = connection.Execute(sb.ToString(), entityToDelete, transaction: transaction, commandTimeout: commandTimeout); 278 | return deleted > 0; 279 | } 280 | 281 | public static ISqlAdapter GetFormatter(IDbConnection connection) 282 | { 283 | string name = connection.GetType().Name.ToLower(); 284 | if (!AdapterDictionary.ContainsKey(name)) 285 | return new SqlServerAdapter(); 286 | return AdapterDictionary[name]; 287 | } 288 | 289 | class ProxyGenerator 290 | { 291 | private static readonly Dictionary TypeCache = new Dictionary(); 292 | 293 | private static AssemblyBuilder GetAsmBuilder(string name) 294 | { 295 | var assemblyBuilder = Thread.GetDomain().DefineDynamicAssembly(new AssemblyName { Name = name }, 296 | AssemblyBuilderAccess.Run); //NOTE: to save, use RunAndSave 297 | 298 | return assemblyBuilder; 299 | } 300 | 301 | public static T GetClassProxy() 302 | { 303 | // A class proxy could be implemented if all properties are virtual 304 | // otherwise there is a pretty dangerous case where internal actions will not update dirty tracking 305 | throw new NotImplementedException(); 306 | } 307 | 308 | 309 | public static T GetInterfaceProxy() 310 | { 311 | Type typeOfT = typeof(T); 312 | 313 | object k; 314 | if (TypeCache.TryGetValue(typeOfT, out k)) 315 | { 316 | return (T)k; 317 | } 318 | var assemblyBuilder = GetAsmBuilder(typeOfT.Name); 319 | 320 | var moduleBuilder = assemblyBuilder.DefineDynamicModule("SqlMapperExtensions." + typeOfT.Name); //NOTE: to save, add "asdasd.dll" parameter 321 | 322 | var interfaceType = typeof(Dapper.Contrib.Extensions.SqlMapperExtensions.IProxy); 323 | var typeBuilder = moduleBuilder.DefineType(typeOfT.Name + "_" + Guid.NewGuid(), 324 | TypeAttributes.Public | TypeAttributes.Class); 325 | typeBuilder.AddInterfaceImplementation(typeOfT); 326 | typeBuilder.AddInterfaceImplementation(interfaceType); 327 | 328 | //create our _isDirty field, which implements IProxy 329 | var setIsDirtyMethod = CreateIsDirtyProperty(typeBuilder); 330 | 331 | // Generate a field for each property, which implements the T 332 | foreach (var property in typeof(T).GetProperties()) 333 | { 334 | var isId = property.GetCustomAttributes(true).Any(a => a is KeyAttribute); 335 | CreateProperty(typeBuilder, property.Name, property.PropertyType, setIsDirtyMethod, isId); 336 | } 337 | 338 | var generatedType = typeBuilder.CreateType(); 339 | 340 | //assemblyBuilder.Save(name + ".dll"); //NOTE: to save, uncomment 341 | 342 | var generatedObject = Activator.CreateInstance(generatedType); 343 | 344 | TypeCache.Add(typeOfT, generatedObject); 345 | return (T)generatedObject; 346 | } 347 | 348 | 349 | private static MethodInfo CreateIsDirtyProperty(TypeBuilder typeBuilder) 350 | { 351 | var propType = typeof(bool); 352 | var field = typeBuilder.DefineField("_" + "IsDirty", propType, FieldAttributes.Private); 353 | var property = typeBuilder.DefineProperty("IsDirty", 354 | System.Reflection.PropertyAttributes.None, 355 | propType, 356 | new Type[] { propType }); 357 | 358 | const MethodAttributes getSetAttr = MethodAttributes.Public | MethodAttributes.NewSlot | MethodAttributes.SpecialName | 359 | MethodAttributes.Final | MethodAttributes.Virtual | MethodAttributes.HideBySig; 360 | 361 | // Define the "get" and "set" accessor methods 362 | var currGetPropMthdBldr = typeBuilder.DefineMethod("get_" + "IsDirty", 363 | getSetAttr, 364 | propType, 365 | Type.EmptyTypes); 366 | var currGetIL = currGetPropMthdBldr.GetILGenerator(); 367 | currGetIL.Emit(OpCodes.Ldarg_0); 368 | currGetIL.Emit(OpCodes.Ldfld, field); 369 | currGetIL.Emit(OpCodes.Ret); 370 | var currSetPropMthdBldr = typeBuilder.DefineMethod("set_" + "IsDirty", 371 | getSetAttr, 372 | null, 373 | new Type[] { propType }); 374 | var currSetIL = currSetPropMthdBldr.GetILGenerator(); 375 | currSetIL.Emit(OpCodes.Ldarg_0); 376 | currSetIL.Emit(OpCodes.Ldarg_1); 377 | currSetIL.Emit(OpCodes.Stfld, field); 378 | currSetIL.Emit(OpCodes.Ret); 379 | 380 | property.SetGetMethod(currGetPropMthdBldr); 381 | property.SetSetMethod(currSetPropMthdBldr); 382 | var getMethod = typeof(Dapper.Contrib.Extensions.SqlMapperExtensions.IProxy).GetMethod("get_" + "IsDirty"); 383 | var setMethod = typeof(Dapper.Contrib.Extensions.SqlMapperExtensions.IProxy).GetMethod("set_" + "IsDirty"); 384 | typeBuilder.DefineMethodOverride(currGetPropMthdBldr, getMethod); 385 | typeBuilder.DefineMethodOverride(currSetPropMthdBldr, setMethod); 386 | 387 | return currSetPropMthdBldr; 388 | } 389 | 390 | private static void CreateProperty(TypeBuilder typeBuilder, string propertyName, Type propType, MethodInfo setIsDirtyMethod, bool isIdentity) 391 | { 392 | //Define the field and the property 393 | var field = typeBuilder.DefineField("_" + propertyName, propType, FieldAttributes.Private); 394 | var property = typeBuilder.DefineProperty(propertyName, 395 | System.Reflection.PropertyAttributes.None, 396 | propType, 397 | new Type[] { propType }); 398 | 399 | const MethodAttributes getSetAttr = MethodAttributes.Public | MethodAttributes.Virtual | 400 | MethodAttributes.HideBySig; 401 | 402 | // Define the "get" and "set" accessor methods 403 | var currGetPropMthdBldr = typeBuilder.DefineMethod("get_" + propertyName, 404 | getSetAttr, 405 | propType, 406 | Type.EmptyTypes); 407 | 408 | var currGetIL = currGetPropMthdBldr.GetILGenerator(); 409 | currGetIL.Emit(OpCodes.Ldarg_0); 410 | currGetIL.Emit(OpCodes.Ldfld, field); 411 | currGetIL.Emit(OpCodes.Ret); 412 | 413 | var currSetPropMthdBldr = typeBuilder.DefineMethod("set_" + propertyName, 414 | getSetAttr, 415 | null, 416 | new Type[] { propType }); 417 | 418 | //store value in private field and set the isdirty flag 419 | var currSetIL = currSetPropMthdBldr.GetILGenerator(); 420 | currSetIL.Emit(OpCodes.Ldarg_0); 421 | currSetIL.Emit(OpCodes.Ldarg_1); 422 | currSetIL.Emit(OpCodes.Stfld, field); 423 | currSetIL.Emit(OpCodes.Ldarg_0); 424 | currSetIL.Emit(OpCodes.Ldc_I4_1); 425 | currSetIL.Emit(OpCodes.Call, setIsDirtyMethod); 426 | currSetIL.Emit(OpCodes.Ret); 427 | 428 | //TODO: Should copy all attributes defined by the interface? 429 | if (isIdentity) 430 | { 431 | var keyAttribute = typeof(KeyAttribute); 432 | var myConstructorInfo = keyAttribute.GetConstructor(new Type[] { }); 433 | var attributeBuilder = new CustomAttributeBuilder(myConstructorInfo, new object[] { }); 434 | property.SetCustomAttribute(attributeBuilder); 435 | } 436 | 437 | property.SetGetMethod(currGetPropMthdBldr); 438 | property.SetSetMethod(currSetPropMthdBldr); 439 | var getMethod = typeof(T).GetMethod("get_" + propertyName); 440 | var setMethod = typeof(T).GetMethod("set_" + propertyName); 441 | typeBuilder.DefineMethodOverride(currGetPropMthdBldr, getMethod); 442 | typeBuilder.DefineMethodOverride(currSetPropMthdBldr, setMethod); 443 | } 444 | 445 | } 446 | } 447 | 448 | [AttributeUsage(AttributeTargets.Class)] 449 | public class TableAttribute : Attribute 450 | { 451 | public TableAttribute(string tableName) 452 | { 453 | Name = tableName; 454 | } 455 | public string Name { get; private set; } 456 | } 457 | 458 | // do not want to depend on data annotations that is not in client profile 459 | [AttributeUsage(AttributeTargets.Property)] 460 | public class KeyAttribute : Attribute 461 | { 462 | } 463 | 464 | [AttributeUsage(AttributeTargets.Property)] 465 | public class WriteAttribute : Attribute 466 | { 467 | public WriteAttribute(bool write) 468 | { 469 | Write = write; 470 | } 471 | public bool Write { get; private set; } 472 | } 473 | } 474 | 475 | public interface ISqlAdapter 476 | { 477 | int Insert(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable keyProperties, object entityToInsert); 478 | } 479 | 480 | public class SqlServerAdapter : ISqlAdapter 481 | { 482 | public int Insert(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable keyProperties, object entityToInsert) 483 | { 484 | string cmd = String.Format("insert into {0} ({1}) values ({2})", tableName, columnList, parameterList); 485 | 486 | connection.Execute(cmd, entityToInsert, transaction: transaction, commandTimeout: commandTimeout); 487 | 488 | //NOTE: would prefer to use IDENT_CURRENT('tablename') or IDENT_SCOPE but these are not available on SQLCE 489 | var r = connection.Query("select @@IDENTITY id", transaction: transaction, commandTimeout: commandTimeout); 490 | int id = (int)r.First().id; 491 | if (keyProperties.Any()) 492 | keyProperties.First().SetValue(entityToInsert, id, null); 493 | return id; 494 | } 495 | } 496 | 497 | public class PostgresAdapter : ISqlAdapter 498 | { 499 | public int Insert(IDbConnection connection, IDbTransaction transaction, int? commandTimeout, String tableName, string columnList, string parameterList, IEnumerable keyProperties, object entityToInsert) 500 | { 501 | StringBuilder sb = new StringBuilder(); 502 | sb.AppendFormat("insert into {0} ({1}) values ({2})", tableName, columnList, parameterList); 503 | 504 | // If no primary key then safe to assume a join table with not too much data to return 505 | if (!keyProperties.Any()) 506 | sb.Append(" RETURNING *"); 507 | else 508 | { 509 | sb.Append(" RETURNING "); 510 | bool first = true; 511 | foreach (var property in keyProperties) 512 | { 513 | if (!first) 514 | sb.Append(", "); 515 | first = false; 516 | sb.Append(property.Name); 517 | } 518 | } 519 | 520 | var results = connection.Query(sb.ToString(), entityToInsert, transaction: transaction, commandTimeout: commandTimeout); 521 | 522 | // Return the key by assinging the corresponding property in the object - by product is that it supports compound primary keys 523 | int id = 0; 524 | foreach (var p in keyProperties) 525 | { 526 | var value = ((IDictionary)results.First())[p.Name.ToLower()]; 527 | p.SetValue(entityToInsert, value, null); 528 | if (id == 0) 529 | id = Convert.ToInt32(value); 530 | } 531 | return id; 532 | } 533 | } -------------------------------------------------------------------------------- /dapper-net-sample/Entity/Product.cs: -------------------------------------------------------------------------------- 1 | using Dapper.Contrib.Extensions; 2 | 3 | namespace dapper_net_sample.Entity 4 | { 5 | // property data type should match exactly with defined in sql server database. 6 | public class Product 7 | { 8 | [Key] 9 | public int Id { get; set; } 10 | 11 | public string ProductName { get; set; } 12 | 13 | public int SupplierID { get; set; } 14 | 15 | public int CategoryID { get; set; } 16 | 17 | public string QuantityPerUnit { get; set; } 18 | 19 | public decimal UnitPrice { get; set; } 20 | 21 | public short? UnitsInStock { get; set; } 22 | 23 | public short? UnitsOnOrder { get; set; } 24 | 25 | public short? ReorderLevel { get; set; } 26 | 27 | public bool Discontinued { get; set; } 28 | 29 | // reference 30 | public Supplier Supplier { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /dapper-net-sample/Entity/Supplier.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Dapper.Contrib.Extensions; 3 | 4 | namespace dapper_net_sample.Entity 5 | { 6 | public interface ISupplier 7 | { 8 | [Key] 9 | int Id { get; set; } 10 | 11 | string CompanyName { get; set; } 12 | string ContactName { get; set; } 13 | string ContactTitle { get; set; } 14 | string Address { get; set; } 15 | string City { get; set; } 16 | string PostalCode { get; set; } 17 | string Country { get; set; } 18 | IEnumerable Products { get; set; } 19 | } 20 | 21 | public class Supplier : ISupplier 22 | { 23 | public int Id { get; set; } 24 | public string CompanyName { get; set; } 25 | public string ContactName { get; set; } 26 | public string ContactTitle { get; set; } 27 | public string Address { get; set; } 28 | public string City { get; set; } 29 | public string PostalCode { get; set; } 30 | public string Country { get; set; } 31 | public IEnumerable Products { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /dapper-net-sample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | 8 | [assembly: AssemblyTitle("dapper-net-sample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("dapper-net-sample")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | 25 | [assembly: Guid("f751c157-7549-4d72-bd78-a832fd302f88")] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [assembly: AssemblyVersion("1.0.*")] 37 | 38 | [assembly: AssemblyVersion("1.0.0.0")] 39 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /dapper-net-sample/Rainbow_Insert_New_Entity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Entity; 6 | 7 | namespace dapper_net_sample 8 | { 9 | public class Rainbow_Insert_New_Entity 10 | { 11 | public static void Main() 12 | { 13 | string connectionString = ConfigurationManager.ConnectionStrings["database-connection-2"].ConnectionString; 14 | 15 | using (var sqlConnection 16 | = new SqlConnection(connectionString)) 17 | { 18 | sqlConnection.Open(); 19 | 20 | var db = NorthwindDatabase.Init(sqlConnection, commandTimeout: 2); 21 | int? supplierId = db.Suppliers.Insert(new 22 | { 23 | CompanyName = Guid.NewGuid().ToString() 24 | 25 | }); 26 | Console.WriteLine(string.Format("New Supplier Id is {0}", supplierId.Value)); 27 | 28 | } 29 | } 30 | } 31 | 32 | public class NorthwindDatabase : Database 33 | { 34 | public Table Suppliers { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /dapper-net-sample/Rainbow_Select_All_Entities.cs: -------------------------------------------------------------------------------- 1 | using System.Configuration; 2 | using System.Data.SqlClient; 3 | using dapper_net_sample.Utility; 4 | 5 | namespace dapper_net_sample 6 | { 7 | public class Rainbow_Select_All_Entities 8 | { 9 | public static void Main() 10 | { 11 | string connectionString = ConfigurationManager.ConnectionStrings["database-connection-2"].ConnectionString; 12 | 13 | using (var sqlConnection = new SqlConnection(connectionString)) 14 | { 15 | sqlConnection.Open(); 16 | 17 | var db = NorthwindDatabase.Init(sqlConnection, commandTimeout: 2); 18 | 19 | var result = db.Suppliers.All(); 20 | 21 | foreach (var supplier in result) 22 | { 23 | ObjectDumper.Write(supplier); 24 | } 25 | 26 | } 27 | 28 | 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /dapper-net-sample/Rainbow_Update_One_Entity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Data.SqlClient; 4 | using Dapper; 5 | using dapper_net_sample.Utility; 6 | 7 | namespace dapper_net_sample 8 | { 9 | public class Rainbow_Update_One_Entity 10 | { 11 | public static void Main() 12 | { 13 | string connectionString = ConfigurationManager.ConnectionStrings["database-connection-2"].ConnectionString; 14 | 15 | using (var sqlConnection 16 | = new SqlConnection(connectionString)) 17 | { 18 | sqlConnection.Open(); 19 | 20 | var db = NorthwindDatabase.Init(sqlConnection, commandTimeout: 3); 21 | 22 | var supplier = db.Suppliers.Get(9); 23 | 24 | // snapshotter tracks which fields change on the object 25 | 26 | var s = Snapshotter.Start(supplier); 27 | 28 | supplier.CompanyName += "_" + Guid.NewGuid().ToString().Substring(1, 4); 29 | 30 | db.Suppliers.Update(9, s.Diff()); 31 | 32 | // reload it from database 33 | supplier = db.Suppliers.Get(9); 34 | 35 | ObjectDumper.Write(supplier); 36 | } 37 | 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /dapper-net-sample/Utility/Constant.cs: -------------------------------------------------------------------------------- 1 | using System.Configuration; 2 | 3 | namespace dapper_net_sample.Utility 4 | { 5 | public class Constant 6 | { 7 | public static string DatabaseConnection = 8 | ConfigurationManager.ConnectionStrings["database-connection-2"].ConnectionString; 9 | } 10 | } -------------------------------------------------------------------------------- /dapper-net-sample/Utility/ObjectDumper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.IO; 4 | using System.Reflection; 5 | 6 | namespace dapper_net_sample.Utility 7 | { 8 | public class ObjectDumper 9 | { 10 | private readonly int depth; 11 | private int level; 12 | private int pos; 13 | private TextWriter writer; 14 | 15 | private ObjectDumper(int depth) 16 | { 17 | this.depth = depth; 18 | } 19 | 20 | public static void Write(object element) 21 | { 22 | Write(element, 0); 23 | } 24 | 25 | public static void Write(object element, int depth) 26 | { 27 | Write(element, depth, Console.Out); 28 | } 29 | 30 | public static void Write(object element, int depth, TextWriter log) 31 | { 32 | var dumper = new ObjectDumper(depth); 33 | dumper.writer = log; 34 | dumper.WriteObject(null, element); 35 | } 36 | 37 | private void Write(string s) 38 | { 39 | if (s != null) 40 | { 41 | writer.Write(s); 42 | pos += s.Length; 43 | } 44 | } 45 | 46 | private void WriteIndent() 47 | { 48 | for (int i = 0; i < level; i++) writer.Write(" "); 49 | } 50 | 51 | private void WriteLine() 52 | { 53 | writer.WriteLine(); 54 | pos = 0; 55 | } 56 | 57 | private void WriteTab() 58 | { 59 | Write(" "); 60 | while (pos%8 != 0) Write(" "); 61 | } 62 | 63 | private void WriteObject(string prefix, object element) 64 | { 65 | if (element == null || element is ValueType || element is string) 66 | { 67 | WriteIndent(); 68 | Write(prefix); 69 | WriteValue(element); 70 | WriteLine(); 71 | } 72 | else 73 | { 74 | var enumerableElement = element as IEnumerable; 75 | if (enumerableElement != null) 76 | { 77 | foreach (object item in enumerableElement) 78 | { 79 | if (item is IEnumerable && !(item is string)) 80 | { 81 | WriteIndent(); 82 | Write(prefix); 83 | Write("..."); 84 | WriteLine(); 85 | if (level < depth) 86 | { 87 | level++; 88 | WriteObject(prefix, item); 89 | level--; 90 | } 91 | } 92 | else 93 | { 94 | WriteObject(prefix, item); 95 | } 96 | } 97 | } 98 | else 99 | { 100 | MemberInfo[] members = element.GetType().GetMembers(BindingFlags.Public | BindingFlags.Instance 101 | /*| BindingFlags.NonPublic */); 102 | Console.WriteLine(members.Length + " Members."); 103 | WriteIndent(); 104 | Write(prefix); 105 | bool propWritten = false; 106 | foreach (MemberInfo m in members) 107 | { 108 | var f = m as FieldInfo; 109 | var p = m as PropertyInfo; 110 | if (f != null || p != null) 111 | { 112 | if (propWritten) 113 | { 114 | WriteTab(); 115 | } 116 | else 117 | { 118 | propWritten = true; 119 | } 120 | Write(m.Name); 121 | Write("="); 122 | Type t = f != null ? f.FieldType : p.PropertyType; 123 | object o = null; 124 | if (t.IsValueType || t == typeof (string)) 125 | { 126 | try 127 | { 128 | o = f != null ? f.GetValue(element) : p.GetValue(element, null); 129 | WriteValue(o); 130 | } 131 | catch (Exception ex) 132 | { 133 | // Had to do this because exceptions are thrown on NumberFormatInfo and other types 134 | // at high depth levels, even though there is a legitimate value obtained. 135 | Console.WriteLine(ex.Message); 136 | WriteValue(o); 137 | } 138 | } 139 | else 140 | { 141 | if (typeof (IEnumerable).IsAssignableFrom(t)) 142 | { 143 | Write("..."); 144 | } 145 | else 146 | { 147 | Write("{ }"); 148 | } 149 | } 150 | } 151 | } 152 | if (propWritten) WriteLine(); 153 | if (level < depth) 154 | { 155 | foreach (MemberInfo m in members) 156 | { 157 | var f = m as FieldInfo; 158 | var p = m as PropertyInfo; 159 | if (f != null || p != null) 160 | { 161 | Type t = f != null ? f.FieldType : p.PropertyType; 162 | object value = null; 163 | if (!(t.IsValueType || t == typeof (string))) 164 | { 165 | try 166 | { 167 | value = f != null ? f.GetValue(element) : p.GetValue(element, null); 168 | } 169 | catch 170 | { 171 | } 172 | 173 | if (value != null) 174 | { 175 | level++; 176 | WriteObject(m.Name + ": ", value); 177 | level--; 178 | } 179 | } 180 | } 181 | } 182 | } 183 | } 184 | } 185 | } 186 | 187 | private void WriteValue(object o) 188 | { 189 | if (o == null) 190 | { 191 | Write("null"); 192 | } 193 | else if (o is DateTime) 194 | { 195 | Write(((DateTime) o).ToShortDateString()); 196 | } 197 | else if (o is ValueType || o is string) 198 | { 199 | Write(o.ToString()); 200 | } 201 | else if (o is IEnumerable) 202 | { 203 | Write("..."); 204 | } 205 | else 206 | { 207 | Write("{ }"); 208 | } 209 | } 210 | } 211 | } -------------------------------------------------------------------------------- /dapper-net-sample/Utility/ProgramSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MiscUtil; 3 | 4 | namespace dapper_net_sample.Utility 5 | { 6 | internal class ProgramSelector 7 | { 8 | [STAThread] 9 | private static void Main(string[] args) 10 | { 11 | ApplicationChooser.Run(typeof (ProgramSelector), args); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /dapper-net-sample/Utility/StackOverflowExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Dapper; 5 | 6 | namespace dapper_net_sample.Extension 7 | { 8 | public static class StackOverflowExtension 9 | { 10 | public static IEnumerable Map 11 | ( 12 | this SqlMapper.GridReader reader, 13 | Func firstKey, 14 | Func secondKey, 15 | Action> addChildren 16 | ) 17 | { 18 | var first = reader.Read().ToList(); 19 | var childMap = reader 20 | .Read() 21 | .GroupBy(s => secondKey(s)) 22 | .ToDictionary(g => g.Key, g => g.AsEnumerable()); 23 | 24 | foreach (var item in first) 25 | { 26 | IEnumerable children; 27 | if(childMap.TryGetValue(firstKey(item), out children)) 28 | { 29 | addChildren(item,children); 30 | } 31 | } 32 | 33 | return first; 34 | } 35 | 36 | } 37 | } -------------------------------------------------------------------------------- /dapper-net-sample/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /dapper-net-sample/dapper-net-sample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {F593A5A9-BC26-4D54-9688-9B2E8EB13962} 9 | Exe 10 | Properties 11 | dapper_net_sample 12 | dapper-net-sample 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | dapper_net_sample.Utility.ProgramSelector 39 | 40 | 41 | 42 | ..\packages\Dapper.1.9\lib\net40\Dapper.dll 43 | 44 | 45 | ..\packages\Dapper.Rainbow.0.1.2\lib\net40\Dapper.Rainbow.dll 46 | 47 | 48 | ..\packages\jot.skeet.miscutil\MiscUtil.dll 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | Designer 90 | 91 | 92 | 93 | 94 | 101 | -------------------------------------------------------------------------------- /dapper-net-sample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /database/Northwind.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/database/Northwind.sql -------------------------------------------------------------------------------- /doc/note.txt: -------------------------------------------------------------------------------- 1 | 1. dapper.net does not support T4 template 2 | 2. dapper,keep clean (all of the them are seperated) 3 | 4 | - dapper 5 | - dapper.SqlMapperExtension 6 | - dapper.SqlBuilder 7 | - dapper.Rainbow 8 | 3. need to create another project to review dapper implementation 9 | 10 | -------------------------------------------------------------------------------- /packages/AnglicanGeek.DbExecutor.0.1.2/AnglicanGeek.DbExecutor.0.1.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/AnglicanGeek.DbExecutor.0.1.2/AnglicanGeek.DbExecutor.0.1.2.nupkg -------------------------------------------------------------------------------- /packages/AnglicanGeek.DbExecutor.0.1.2/lib/net40/AnglicanGeek.DbExecutor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/AnglicanGeek.DbExecutor.0.1.2/lib/net40/AnglicanGeek.DbExecutor.dll -------------------------------------------------------------------------------- /packages/CavemanTools.1.4.0.40894/CavemanTools.1.4.0.40894.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/CavemanTools.1.4.0.40894/CavemanTools.1.4.0.40894.nupkg -------------------------------------------------------------------------------- /packages/CavemanTools.1.4.0.40894/lib/net40/CavemanTools.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CavemanTools 5 | 6 | 7 | 8 | 9 | Default implementation of IOnlineUserInfo 10 | 11 | 12 | 13 | 14 | Defines the minimum information required about an online user. 15 | Used by implementations of IOnlineUsersRepository 16 | 17 | 18 | 19 | 20 | Gets or sets user id, use null for anonymous users 21 | 22 | 23 | 24 | 25 | Gets or sets the name of the user 26 | 27 | 28 | 29 | 30 | Gets if the visitor is anonymous 31 | 32 | 33 | 34 | 35 | Gets or sets user id, use null for anonymous users 36 | 37 | 38 | 39 | 40 | Gets or sets the name of the user 41 | 42 | 43 | 44 | 45 | Gets or sets the date when the user checked in 46 | 47 | 48 | 49 | 50 | Gets if the visitor is anonymous 51 | 52 | 53 | 54 | 55 | Formats strings using named parameters {param} 56 | 57 | 58 | 59 | 60 | Formats the string using named parameters 61 | 62 | String having {param} 63 | Anonymous object where properties are the names of the parameters 64 | 65 | 66 | 67 | 68 | Formats the string using named parameters 69 | 70 | String having {param} 71 | Anonymous object where properties are the names of the parameters 72 | 73 | 74 | 75 | 76 | Caches a single object in a cookie 77 | 78 | Type of object 79 | 80 | 81 | 82 | Provides caching functionality for one value 83 | 84 | 85 | 86 | 87 | 88 | Saves value into response cookie. 89 | Uses object's ToString() 90 | 91 | Response cookie collection 92 | 93 | 94 | 95 | Tries to load object from request cookie, using the supplied parser 96 | 97 | Request cookie collection 98 | Parser to convert cookie value to object 99 | 100 | 101 | 102 | 103 | Cleans up the cookie 104 | 105 | Response cookie collection 106 | 107 | 108 | 109 | Gets or sets object 110 | 111 | 112 | 113 | 114 | Gets the underlaying cookie 115 | 116 | 117 | 118 | 119 | Gets or sets cookie name which stores the value of parameter 120 | 121 | 122 | 123 | 124 | 125 | 126 | Cookie name 127 | Value 128 | 129 | 130 | 131 | Saves value into response cookie. 132 | Uses object's ToString() 133 | 134 | Response cookie collection 135 | 136 | 137 | 138 | Loads object from request cookie. 139 | It uses the default parser to create the object 140 | 141 | Request cookie collection 142 | 143 | 144 | 145 | Loads object from request cookie, using the supplied parser 146 | 147 | Request cookie collection 148 | Parser to convert cookie value to object 149 | 150 | 151 | 152 | 153 | Cleans up the cookie 154 | 155 | Response cookie collection 156 | 157 | 158 | 159 | Gets or sets object 160 | 161 | 162 | 163 | 164 | Gets or sets cookie name which stores the value of parameter 165 | 166 | 167 | 168 | 169 | Gets the underlying cookie 170 | 171 | 172 | 173 | 174 | Gets the group id value 175 | 176 | 177 | 178 | 179 | Gets the rights assigned to group 180 | 181 | 182 | 183 | 184 | Create an object from type using the parameterless constructor. 185 | Faster than Activator on average by 2x. Use it if you need to create many of objects of the same type at the same location 186 | 187 | 188 | 189 | 190 | Compares two sequences and returns the added or removed items. 191 | 192 | Implements IEquatable 193 | Recent sequence 194 | Older sequence used as base of comparison 195 | 196 | 197 | 198 | 199 | Compares two sequences and returns the added or removed items. 200 | Use this when T doesn't implement IEquatable 201 | 202 | Type 203 | Recent sequence 204 | Older sequence used as base of comparison 205 | function to check equality 206 | 207 | 208 | 209 | 210 | Compares two sequences and returns the result. 211 | This special case method is best used when you have identifiable objects that can change their content/value but not their id. 212 | 213 | Implements IEquatable 214 | Recent sequence 215 | Older sequence used as base of comparison 216 | Delegate to determine if the items are identical. 217 | First parameter is new item, second is the item used as base for comparison 218 | 219 | 220 | 221 | 222 | Updates the old collection with new items, while removing the inexistent. 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | Updates the old collection with new items, while removing the inexistent. 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | Checks if a collection is null or empty duh! 241 | 242 | Type 243 | collection 244 | 245 | 246 | 247 | 248 | Gets typed value from dictionary or a default value if key is missing 249 | 250 | 251 | 252 | 253 | Value to return if dictionary doesn't contain the key 254 | 255 | 256 | 257 | 258 | Handles a request parameter which personalizes the request and can be temporary stored, 259 | such as a theme, language, number of items etc 260 | 261 | 262 | 263 | 264 | Initializes with default settings: generic string parser, cookie caching 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | Response cookie collection 273 | String parser to object 274 | Caching implementation 275 | Request cookie collection 276 | 277 | 278 | 279 | Tries to load parameter from a string 280 | 281 | 282 | 283 | 284 | 285 | 286 | Tries to load parameter from cache 287 | 288 | 289 | 290 | 291 | 292 | Caches value using provided caching implementation 293 | 294 | 295 | 296 | 297 | Gets or sets the parameter value 298 | 299 | 300 | 301 | 302 | Gets or sets caching storage object 303 | 304 | 305 | 306 | 307 | Establish UI Culture for current request 308 | 309 | 310 | var req=new RequestLocale(Request.Cookies,Response.Cookies); 311 | if (req.LoadFromString(Request.QueryString["lang"])) 312 | { 313 | req.Cache(); 314 | } 315 | else 316 | { 317 | req.LoadFromCache(); 318 | } 319 | 320 | if (req.Value!=null) Thread.CurrentThread.CurrentCulture = req.Value 321 | 322 | 323 | 324 | 325 | Sets the UICulture of the thread with the value if not empty 326 | 327 | 328 | 329 | 330 | This class formats a tempalte file into a Mail Message 331 | 332 | 333 | 334 | 335 | Loads the template from file. Template uses {ParamName} for parameters 336 | 337 | File path 338 | 339 | 340 | 341 | Creates the message body from template. 342 | 343 | 344 | 345 | 346 | 347 | Gets or sets the template string. Template uses {ParamName} for parameters. 348 | 349 | 350 | 351 | 352 | Gets the mail message with formatted body. 353 | 354 | 355 | 356 | 357 | Generic string parser class 358 | 359 | Type to parse string to 360 | 361 | 362 | 363 | Provides functionality to parse a string into object 364 | 365 | Type 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | Tries to parse text into type. Returns true if successful 378 | 379 | Text to parse 380 | Value or default of type 381 | 382 | 383 | 384 | 385 | Helper to set/get objects in the current http context 386 | 387 | 388 | 389 | 390 | INterface for the result of 2 sequences comparison 391 | 392 | Implements IEquatable 393 | 394 | 395 | 396 | Gets the sequence of items added 397 | 398 | 399 | 400 | 401 | Gets the sequence of items removed 402 | 403 | 404 | 405 | 406 | Gets the sequence of items modified 407 | 408 | 409 | 410 | 411 | Nothing has been added,removed or modified. 412 | 413 | 414 | 415 | 416 | Generic event args 417 | 418 | 419 | 420 | 421 | 422 | Gets the IP of the user detects proxy 423 | 424 | 425 | 426 | 427 | 428 | 429 | Returns subdomain from url 430 | 431 | 432 | Host name 433 | 434 | 435 | 436 | 437 | Tries to detect if the requested path is a static resource 438 | 439 | 440 | 441 | 442 | 443 | 444 | Gets an object from context items 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | Gets an object from context items 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | Gets groups ids 465 | 466 | 467 | 468 | 469 | Use it to encapsulate password hash generation. 470 | 471 | 472 | 473 | 474 | Generates a password hash using sha256 475 | 476 | 477 | A random 7 characters string will be used if empty 478 | 479 | 480 | 481 | Generates a password hash using the specified hashing strategy 482 | 483 | 484 | Hashing strategy, implement 485 | A random 7 characters string will be used if empty 486 | 487 | 488 | 489 | Gets hashed password 490 | 491 | 492 | 493 | 494 | Used to centralize multiple validations 495 | 496 | 497 | 498 | 499 | DEfault validation state is invalid 500 | 501 | 502 | 503 | 504 | 505 | 506 | State of bag: valid or invalid 507 | 508 | 509 | 510 | Adds validation result 511 | 512 | 513 | 514 | 515 | 516 | Gets if all the validations were successful 517 | 518 | 519 | 520 | 521 | Validates if the value's length is between minimum and maximum length 522 | 523 | 524 | 525 | 526 | 527 | 528 | Maximum Length is negative 529 | Maximum length 530 | 531 | 532 | 533 | Maximum length for string 534 | 535 | 536 | 537 | 538 | Minimum lenght for string 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | Creates url friendly slug of a string 549 | 550 | 551 | 552 | 553 | 554 | 555 | Parses string to culture. Returns null if unsuccessful. 556 | 557 | 558 | 559 | 560 | 561 | 562 | Cuts the string to the specified length 563 | 564 | string 565 | maximum length 566 | 567 | 568 | 569 | 570 | Converts strings form unicode to specified encoding 571 | 572 | String 573 | Encoding 574 | 575 | 576 | 577 | 578 | Capitalizes the first letter from string. 579 | 580 | 581 | 582 | 583 | 584 | 585 | Reads the Stream as an UTF8 String 586 | 587 | Stream 588 | 589 | 590 | 591 | 592 | Returns true if teh string is a valid email format. 593 | 594 | 595 | 596 | 597 | 598 | 599 | Returns the first line from a multilined string 600 | 601 | 602 | 603 | 604 | 605 | 606 | Generates a random string (only letters) of the specified length 607 | 608 | Maximum string length 609 | 610 | 611 | 612 | 613 | Hash a string using the SHA256 algorithm. 32 bytes (hex): 64 unicode chars, 128 bytes 614 | 615 | 616 | 617 | 618 | hash length is 40 unicode chars 619 | 620 | 621 | 622 | 623 | 624 | 625 | Hash a string using the SHA512 algorithm. 128 bytes(hex): 256 unicode chars 626 | 627 | 628 | 629 | 630 | Creates MD5 sum from string, 16 bytes(hex): 32 unicode chars 631 | 632 | 633 | 634 | 635 | 636 | 637 | Encrypts using AES (Rijndael) standard 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | Returns encrypted data as Base64 string 646 | 647 | 648 | Salt of 16 chars 649 | 650 | 651 | 652 | 653 | Ensures secret length of 16 chars 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | Returns decrypted data from Base64 string 662 | 663 | Base 64 encoded encryption 664 | Salt of 16 chars 665 | 666 | 667 | 668 | 669 | 670 | 671 | Generates hex representation of bytes 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 32 bytes size (16 unicode length) 681 | 682 | 683 | 684 | 685 | Values is 0 686 | 687 | 688 | 689 | 690 | Value is 1 691 | 692 | 693 | 694 | 695 | Value is 2 696 | 697 | 698 | 699 | 700 | Use to abstract the usage of an explicit logger (log4net, nlog etc) 701 | Implement it or extend the LogWriteBase. 702 | 703 | 704 | 705 | 706 | Should return the real logger implementation 707 | 708 | Logger type 709 | 710 | 711 | 712 | 713 | Writes a log entry with the specified logging level 714 | 715 | Status 716 | Entry Text 717 | 718 | 719 | 720 | Writes a formatted log entry with the specified logging level 721 | 722 | Status 723 | Entry Text 724 | List of arguments 725 | 726 | 727 | 728 | Used to validate objects 729 | 730 | 731 | 732 | 733 | Validate object properties using Data Annotations, registering the error messages in process 734 | 735 | Type decorated with Validation Attributes 736 | Object 737 | 738 | 739 | 740 | Validate object properties using Data Annotations, registering the error messages in process 741 | 742 | Type decorated with Validation Attributes 743 | Object 744 | Error dictionary,can be null 745 | 746 | 747 | 748 | Validates a value according to validation attributes of a class, ignoring the errors 749 | 750 | Type decorated with validation attributes 751 | Value to be validated 752 | 753 | 754 | 755 | Validates a value according to validation attributes of a class, registering error messages. 756 | 757 | Type decorated with validation attributes 758 | Value to be validated 759 | Error dictionary, can be null 760 | 761 | 762 | 763 | Validates a value according to validation attributes of a property, ignoring the errors. 764 | 765 | Type which contains property 766 | Value to be validated 767 | Property decorated with validation attributes 768 | 769 | 770 | 771 | Validates a value according to validation attributes of a property, registering the error messages. 772 | 773 | Type which contains property 774 | Value to be validated 775 | Property decorated with validation attributes 776 | Error dictionary, can be null 777 | 778 | 779 | 780 | Default implementation to collect validation errors for the same item 781 | 782 | 783 | 784 | 785 | Provide the functionality to collect multiple errors messages for the same key 786 | 787 | 788 | 789 | 790 | Adds error for key 791 | 792 | 793 | 794 | 795 | 796 | Field Name 797 | 798 | 799 | 800 | 801 | 802 | 803 | Error Key 804 | Error Bag 805 | 806 | 807 | 808 | Validates that a string has mnimum length 809 | 810 | 811 | 812 | 813 | 814 | 815 | Minimum length 816 | 817 | 818 | 819 | Gets minimum length 820 | 821 | 822 | 823 | 824 | Provides functioanlity to encrypt and decrypt a cookie 825 | 826 | 827 | 828 | 829 | Encrypts cookie 830 | 831 | HttpCookie 832 | 833 | 834 | 835 | Descrypts cookie 836 | 837 | Cookie 838 | 839 | 840 | 841 | Gets encryption secret (between 8 and 16 characters) 842 | 843 | 844 | 845 | 846 | Change the AdminRight field to the value you want 847 | 848 | 849 | 850 | 851 | True if user has the specified right 852 | 853 | 854 | 855 | 856 | 857 | 858 | True if the user is a member of at least one of the groups 859 | 860 | 861 | 862 | 863 | 864 | 865 | Gets the user id or null if anonymous 866 | 867 | 868 | 869 | 870 | User name or null if anonymous 871 | 872 | 873 | 874 | 875 | Gets the status of request 876 | 877 | 878 | 879 | 880 | Gets a dictionary where you can store other information about the user 881 | 882 | 883 | 884 | 885 | Value of Admin right. 886 | Default is UserBasicRights.DoEverything 887 | 888 | 889 | 890 | 891 | Checks if user has the specified right or the admin right 892 | 893 | right id 894 | 895 | 896 | 897 | 898 | True if user is member of one of the specified groups 899 | 900 | 901 | 902 | 903 | 904 | 905 | Gets the user id or null if anonymous 906 | 907 | 908 | 909 | 910 | User name or empty if anonymous 911 | 912 | 913 | 914 | 915 | Gets a dictionary where you can store other information about the user 916 | 917 | 918 | 919 | 920 | This exception is used to communicate errors to the UI 921 | 922 | 923 | 924 | 925 | Provides functionality for repository managing online users list 926 | 927 | 928 | 929 | 930 | Gets the list of online users 931 | 932 | 933 | 934 | 935 | 936 | Registers a visitor as being online 937 | 938 | Username or a random string for anonymous users 939 | Can be null for anonymous users 940 | 941 | 942 | 943 | Gets or sets the time period in which an user is considered online 944 | Default is 15 minutes 945 | 946 | 947 | 948 | 949 | Implements the user id value as an int 950 | 951 | 952 | 953 | 954 | Base class to implement user id value 955 | 956 | Underlying value type 957 | 958 | 959 | 960 | Gets the id as the underlying type. 961 | Default is int 962 | 963 | 964 | 965 | 966 | 967 | 968 | Id value as string 969 | 970 | 971 | 972 | 973 | 974 | Gets the id as an object 975 | 976 | 977 | 978 | 979 | Validates a string as an email 980 | 981 | 982 | 983 | 984 | Returns reflection information for a property expression 985 | 986 | Type 987 | Lambda returning the property 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | Returns true if an xml node is a comment 998 | 999 | XmlNode 1000 | 1001 | 1002 | 1003 | 1004 | Returns true if the node has an attribute of specified name 1005 | 1006 | xmlNode 1007 | Attribute name 1008 | 1009 | 1010 | 1011 | 1012 | Gets the attribute value. If it doesn't exist it returns the default of the type 1013 | 1014 | 1015 | 1016 | Name of attribute 1017 | 1018 | 1019 | 1020 | 1021 | Gets the attribute value. If it doesn't exist it returns the provided value 1022 | 1023 | Type 1024 | 1025 | Name of attribute 1026 | Value to return if attribute does not exists 1027 | 1028 | 1029 | 1030 | 1031 | Gets value of xml as type. 1032 | Returns default of type if not existant or empty. 1033 | 1034 | Type 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | Gets value of xml as type. 1041 | Returns provided value if null. 1042 | 1043 | Type 1044 | 1045 | value if node is null 1046 | 1047 | 1048 | 1049 | 1050 | Converts xmlnode to object whose properties are the attributes names. 1051 | 1052 | Type with parameterless constructor 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | Converts xmlnode to object whose properties are the xml children names. 1059 | 1060 | Type with parameterless constructor 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | Converts xmlnode to Dictionary whose keys are the xml children names and values are children's inner text. 1067 | 1068 | Type with parameterless constructor 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | Converts xmlnode to Dictionary whose keys are the attributes names and values are attributes' inner text. 1075 | 1076 | Type with parameterless constructor 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | Holds limited result set and total number of items from a query. 1083 | Used for pagination. 1084 | 1085 | Type of item 1086 | 1087 | 1088 | 1089 | Holds limited result set and total number of items from a query. 1090 | Used for pagination. 1091 | 1092 | Type of item 1093 | 1094 | 1095 | 1096 | Gets the total number of items 1097 | 1098 | 1099 | 1100 | 1101 | Gets result items 1102 | 1103 | 1104 | 1105 | 1106 | At least 8 characters 1107 | 1108 | 1109 | 1110 | 1111 | Returns all custom attributes of specified type 1112 | 1113 | Attribute 1114 | Custom attributes provider 1115 | 1116 | 1117 | 1118 | 1119 | Returns all custom attributes of specified type 1120 | 1121 | Attribute 1122 | Custom attributes provider 1123 | When true, look up the hierarchy chain for custom attribute 1124 | 1125 | 1126 | 1127 | 1128 | Gets a single or the first custom attribute of specified type 1129 | 1130 | Attribute 1131 | Custom Attribute provider 1132 | 1133 | 1134 | 1135 | 1136 | Contains extensions methods for log writing 1137 | 1138 | 1139 | 1140 | 1141 | Writes DEBUG entry in log if logger is not null. 1142 | If null it does nothing 1143 | 1144 | 1145 | Log Entry Text 1146 | 1147 | 1148 | 1149 | Writes and formats DEBUG entry in log if logger is not null. 1150 | If null it does nothing 1151 | 1152 | 1153 | Log Entry Format Text 1154 | Format params 1155 | 1156 | 1157 | 1158 | Writes entry in log if logger is not null. 1159 | If null it does nothing 1160 | 1161 | 1162 | Log Entry Text 1163 | Log Level 1164 | 1165 | 1166 | 1167 | Writes and formats entry in log if logger is not null. 1168 | If null it does nothing 1169 | 1170 | 1171 | Log Entry Format Text 1172 | Log Level 1173 | Format params 1174 | 1175 | 1176 | 1177 | A simple bag object, where a string key can hold a list of string values 1178 | 1179 | 1180 | 1181 | 1182 | Provide functionality to hold validation errors messages 1183 | 1184 | 1185 | 1186 | 1187 | Adds error message for key 1188 | 1189 | field identifier 1190 | Error message 1191 | 1192 | 1193 | 1194 | Returns true if there are errors messages 1195 | 1196 | 1197 | 1198 | 1199 | Gets if object state is valid 1200 | 1201 | 1202 | 1203 | 1204 | Creates dictionary from object properties. 1205 | 1206 | Object 1207 | 1208 | 1209 | 1210 | 1211 | Generates a string containing the properties and values of the object 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | Shallow copies source object into destination, only public properties are copied. Use CopyOptionsAttribute to mark the properties you want ignored. 1219 | Use Automapper for heavy duty mapping 1220 | 1221 | 1222 | Destination type must have parameterless constructor 1223 | Object to copy 1224 | 1225 | 1226 | 1227 | Shallow copies source object into destination, only public properties are copied. For ocasional use. 1228 | Use Automapper for heavy duty mapping 1229 | 1230 | If source or destination are null 1231 | Destination Type 1232 | Object to copy from 1233 | Object to copy to. Unmatching or read-only properties are ignored 1234 | 1235 | 1236 | 1237 | Converts object to type. 1238 | Supports conversion to Enum, DateTime,TimeSpan and CultureInfo 1239 | 1240 | 1241 | Object to be converted 1242 | Type to convert to 1243 | 1244 | 1245 | 1246 | 1247 | Tries to convert the object to type. 1248 | 1249 | 1250 | 1251 | Type to convert to 1252 | Object 1253 | 1254 | 1255 | 1256 | 1257 | Tries to convert the object to type. 1258 | If it fails it returns the specified default value. 1259 | 1260 | Type to convert to 1261 | Object 1262 | IF not set , the default for T is used 1263 | 1264 | 1265 | 1266 | 1267 | Shorthand for lazy people to cast an object to a type 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | Shorthand for lazy people to cast an object to a type 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | IL corresponding to push Type on stack 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | IL to unbox values, also handles Nullable 1291 | 1292 | 1293 | value type 1294 | 1295 | 1296 | 1297 | Console.WriteLine for the value on the stack 1298 | 1299 | 1300 | 1301 | 1302 | 1303 | Shows message followed by current object from the top of the stack 1304 | 1305 | 1306 | 1307 | 1308 | 1309 | 1310 | Returns analytics js code for id 1311 | 1312 | 1313 | 1314 | 1315 | 1316 | 1317 | Returns public types implementing T 1318 | 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | Checks if value can be used "as is" without escaping in a url 1326 | 1327 | 1328 | 1329 | 1330 | Validates that a string doesn't contain unwanted words. 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | Separate by comma 1339 | 1340 | 1341 | 1342 | Gets the forbidden words list 1343 | 1344 | 1345 | 1346 | 1347 | Multiplies a time period by a number 1348 | 1349 | 1350 | 1351 | 1352 | 1353 | 1354 | 1355 | Outputs the 'human friendly' format (ex: 4 days ago). English only 1356 | 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | Password hashing strategy using sha256 1363 | 1364 | 1365 | 1366 | 1367 | Creates a hash for a string using salt 1368 | 1369 | Value to hash 1370 | Optional random string 1371 | 1372 | 1373 | 1374 | 1375 | Creates and attaches to response the authentication cookie 1376 | 1377 | 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | Returns the user context created by the UserRights module 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | Base class for types which will be used as singletons within a http request 1394 | 1395 | Reference type 1396 | 1397 | 1398 | 1399 | Register an instance of T to http context as a request scoped singleton 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | Gets the single instance of type for the current request 1406 | 1407 | 1408 | 1409 | 1410 | Gets enum as enumerable values. 1411 | 1412 | EnumType 1413 | 1414 | 1415 | 1416 | 1417 | Gets enum as enumerable values, skipping the first (usually default,none) value 1418 | 1419 | EnumType 1420 | 1421 | 1422 | 1423 | 1424 | Gets enum as enumerable values, skipping the first (usually default,none) value 1425 | 1426 | EnumType 1427 | 1428 | 1429 | 1430 | 1431 | Parse string to enum 1432 | 1433 | EnumType 1434 | Enum constant 1435 | 1436 | 1437 | 1438 | 1439 | Returns a random enum constant 1440 | 1441 | EnumType 1442 | 1443 | 1444 | 1445 | 1446 | Returns a random enum name 1447 | 1448 | EnumType 1449 | 1450 | 1451 | 1452 | 1453 | Used by IOnlineUsersRepository to return information 1454 | 1455 | 1456 | 1457 | 1458 | Gets the number of anonymous users 1459 | 1460 | 1461 | 1462 | 1463 | Gets a sequence of online members 1464 | 1465 | 1466 | 1467 | 1468 | Manages online users list. Thread safe. 1469 | 1470 | 1471 | 1472 | 1473 | Gets info about the online users. 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | Registers a visitor as being online 1480 | 1481 | Username or a random string for anonymous users 1482 | Can be null for anonymous users 1483 | 1484 | 1485 | 1486 | Returns a sequence of the online authenticated users 1487 | 1488 | 1489 | 1490 | 1491 | 1492 | Gets the number of anonymous users 1493 | 1494 | 1495 | 1496 | 1497 | 1498 | Gets the number of online users 1499 | 1500 | 1501 | 1502 | 1503 | Gets or sets the time period in which an user is considered online 1504 | Default is 15 minutes 1505 | 1506 | 1507 | 1508 | 1509 | Updates or appends a cookie to collection 1510 | 1511 | 1512 | 1513 | 1514 | 1515 | 1516 | Gets typed object from cookie value or a specified default value if invalid cookie 1517 | 1518 | object type 1519 | 1520 | Value to return if cookie doesn't contain a valid value 1521 | 1522 | 1523 | 1524 | 1525 | Gets typed object from cookie value, or default for the type if invalid cookie value 1526 | 1527 | object type 1528 | 1529 | 1530 | 1531 | 1532 | 1533 | Gets typed object from cookie value using parser 1534 | 1535 | object type 1536 | 1537 | Parser to create object from string 1538 | 1539 | 1540 | 1541 | 1542 | Registers a singleton 1543 | 1544 | Reference type 1545 | If an instance already exists 1546 | 1547 | 1548 | 1549 | 1550 | Returns the instance of type or null 1551 | 1552 | Reference type 1553 | 1554 | 1555 | 1556 | 1557 | Unregisters the singleton for the provided type. 1558 | 1559 | Reference type 1560 | true to dispose if the type implements IDisposable 1561 | 1562 | 1563 | 1564 | Provides functionality to validate ValidationAttributes both by declaration and instantiation 1565 | 1566 | Type containing declarated validation attributes 1567 | 1568 | 1569 | 1570 | Gets all the class validation attributes matching type 1571 | 1572 | Implements ValidationAttribute 1573 | 1574 | 1575 | 1576 | 1577 | Gets all the validation attributes matching type for the property 1578 | 1579 | ValidationAttribute inheritor 1580 | Expression Property 1581 | 1582 | 1583 | 1584 | 1585 | Gets all defiend validation attributes for property 1586 | 1587 | Expression property 1588 | 1589 | 1590 | 1591 | 1592 | Registers validator for a property 1593 | 1594 | Property expression 1595 | Validator 1596 | 1597 | 1598 | 1599 | Validates object of type, calling the validators for each property 1600 | It calls both validators defined in this service as well as the declared attributes if any 1601 | 1602 | Object to validate 1603 | 1604 | 1605 | 1606 | 1607 | Validates object of type, calling the validators for each property 1608 | It calls both validators defined in this service as well as the declared attributes if any 1609 | 1610 | type of object 1611 | Object to validate 1612 | Validation error bag, can be null if you don't need errors 1613 | 1614 | 1615 | 1616 | 1617 | Validates the value according to property validators 1618 | 1619 | Property expression 1620 | value to validate 1621 | Error bag, can be null 1622 | 1623 | 1624 | 1625 | 1626 | Validates value with the attributes decorating the class T 1627 | 1628 | Value 1629 | Error bag 1630 | 1631 | 1632 | 1633 | 1634 | Gets the Validation Attributes decorating the class 1635 | 1636 | 1637 | 1638 | 1639 | Creates pagination links 1640 | 1641 | 1642 | 1643 | 1644 | Gets the links to use for pagination 1645 | 1646 | 1647 | 1648 | 1649 | 1650 | Caculates the number of pages 1651 | 1652 | Total items number 1653 | Items shown on a page 1654 | 1655 | 1656 | 1657 | 1658 | Gets or sets the url format for links. 1659 | 1660 | 1661 | 1662 | 1663 | Active page html element format. Default it renders 1664 | <span class="current">{0}<span> 1665 | 1666 | 1667 | 1668 | 1669 | Gets or sets the total results number 1670 | 1671 | 1672 | 1673 | 1674 | Gets or sets the number of results on a page 1675 | 1676 | 1677 | 1678 | 1679 | Gets or sets the current page number 1680 | 1681 | 1682 | 1683 | 1684 | Uses a template to generate the message body. 1685 | The template parameters have the format {Parameter}. 1686 | 1687 | 1688 | Template file path 1689 | Anonymous object with values for placeholders 1690 | 1691 | 1692 | 1693 | Generates the Gravatar id from email. 1694 | 1695 | Email address 1696 | 1697 | 1698 | 1699 | 1700 | Gets group context. If it doesn't exist, it must return an empty object 1701 | 1702 | 1703 | 1704 | 1705 | 1706 | 1707 | Returns the default group for anonymous users 1708 | 1709 | 1710 | 1711 | 1712 | 1713 | Executes function for each sequence item 1714 | 1715 | Sequence 1716 | Function to execute 1717 | 1718 | 1719 | 1720 | 1721 | Used for paginating stuff 1722 | 1723 | 1724 | 1725 | 1726 | How many items should be skipped to reach the result page 1727 | 1728 | Page number 1729 | Number of items on a page 1730 | 1731 | 1732 | 1733 | 1734 | Ensures we have a valid page number 1735 | 1736 | Page number 1737 | 1738 | 1739 | 1740 | 1741 | Interface for command handlers 1742 | 1743 | A reference type 1744 | 1745 | 1746 | 1747 | Handle command 1748 | 1749 | 1750 | 1751 | 1752 | 1753 | 1754 | Interface for command handler when you also need to return a response to the user 1755 | 1756 | reference type 1757 | 1758 | 1759 | 1760 | 1761 | Handle command 1762 | 1763 | 1764 | 1765 | 1766 | 1767 | 1768 | Implments the user id value as a GUID 1769 | 1770 | 1771 | 1772 | 1773 | Default implementation of IModifiedSet. 1774 | The result of 2 sequences comparison 1775 | 1776 | Implements IEquatable 1777 | 1778 | 1779 | 1780 | For fast creation of types, useful for creating POCOs 1781 | 1782 | 1783 | 1784 | 1785 | Gets factory to create instance of type using the public parameterless ctor. 1786 | Use it when you want to create many instances of the same type in different objects 1787 | Aprox, 1.3x faster than Activator, almost as fast a manual if you cache and reuse the delegate 1788 | 1789 | 1790 | 1791 | 1792 | 1793 | 1794 | Collects error messages from validation 1795 | 1796 | 1797 | 1798 | 1799 | Adds validation error message 1800 | 1801 | Key 1802 | Text 1803 | 1804 | 1805 | 1806 | copies errors to another dictionary 1807 | 1808 | 1809 | 1810 | 1811 | 1812 | Returns true if there are no error messages 1813 | 1814 | 1815 | 1816 | 1817 | Parse string into object of type. Returns the default value if not successful. 1818 | 1819 | Type 1820 | String 1821 | 1822 | 1823 | 1824 | 1825 | Parse string into object of type using the provided parser 1826 | 1827 | Type 1828 | String 1829 | Parser for the object 1830 | 1831 | 1832 | 1833 | 1834 | Parse string into object of type. Returns the provided value if not successful. 1835 | 1836 | Type 1837 | String 1838 | Value to return if conversion fails 1839 | 1840 | 1841 | 1842 | 1843 | Requires an utility (like HttpModuleMagic.Mvc3 nuget package) for module dependecy injection. 1844 | Automatically creates UserContext 1845 | 1846 | 1847 | 1848 | 1849 | Validates value according to regular expression. 1850 | 1851 | 1852 | 1853 | 1854 | 1855 | 1856 | 1857 | Regex 1858 | 1859 | 1860 | 1861 | Gets the pattern for validation. 1862 | 1863 | 1864 | 1865 | 1866 | Pair of old and new objects. Used by list comparator 1867 | 1868 | 1869 | 1870 | 1871 | 1872 | Used when copying objects. Further properties may be added in the future. 1873 | 1874 | 1875 | 1876 | 1877 | Gets or sets if the property should be copied. 1878 | 1879 | 1880 | 1881 | 1882 | Unserialize a base64 encoded string into name values 1883 | 1884 | Base64 encoded string 1885 | 1886 | 1887 | 1888 | 1889 | Serialize a name value collecting to base64 encoded string 1890 | 1891 | Base64 encoded string 1892 | 1893 | 1894 | 1895 | 1896 | Agregates values from different sources for an option. 1897 | THe priority strategy selects the final value 1898 | 1899 | Source Type 1900 | Value Type 1901 | 1902 | 1903 | 1904 | Init with default source and default value 1905 | 1906 | key for default value 1907 | default value 1908 | 1909 | 1910 | 1911 | Init with default source and default value specifying priority strategy 1912 | 1913 | key for default value 1914 | default value 1915 | Priority sorting strategy 1916 | 1917 | 1918 | 1919 | Adds value from a source 1920 | 1921 | Source id 1922 | Option Value 1923 | 1924 | 1925 | 1926 | Checks if a value is valid. 1927 | Default checks if it's null 1928 | 1929 | 1930 | 1931 | 1932 | 1933 | 1934 | Priority sorting strategy 1935 | 1936 | 1937 | 1938 | 1939 | Gets option's final value 1940 | 1941 | 1942 | 1943 | 1944 | Specify that a (non-empty) or blanc value is provided. 1945 | 1946 | 1947 | 1948 | 1949 | Encapsulates the url friendly version of a string 1950 | 1951 | 1952 | 1953 | 1954 | 1955 | 1956 | 1957 | Value must not be empty 1958 | 1959 | 1960 | 1961 | Provides an encrypted cookie to store seesion values 1962 | 1963 | 1964 | 1965 | 1966 | Constructs a nw encrypted cookie 1967 | 1968 | Cookie name 1969 | secret salt for encryption 1970 | 1971 | 1972 | 1973 | Constructs a nw encrypted cookie 1974 | 1975 | Cookie name 1976 | secret salt for encryption 1977 | 1978 | 1979 | 1980 | Creates a new encrypted cookie from request or a new one if it's missing 1981 | 1982 | Request collection 1983 | Cookie name 1984 | Secret key 1985 | 1986 | 1987 | 1988 | 1989 | Creates a new encrypted cookie from request or a new one if it's missing 1990 | 1991 | Request collection 1992 | cookie name 1993 | encrypting strategy 1994 | 1995 | 1996 | 1997 | 1998 | Constructs a nw encrypted cookie 1999 | 2000 | 2001 | Cookie 2002 | Encripting strategy 2003 | 2004 | 2005 | 2006 | Decrypts and opens the cookie for modification 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | Encrypts and seals the cookie, nothing can be modified or retrieved 2013 | 2014 | 2015 | 2016 | 2017 | Gets a cookie value as object of type 2018 | 2019 | Object type 2020 | Key 2021 | return this if key was not found or conversion failed 2022 | 2023 | 2024 | 2025 | 2026 | Saves the encrypted cookie into collection 2027 | 2028 | 2029 | If cookie is not sealed it will try to seal it first. 2030 | 2031 | Cookie collection 2032 | 2033 | 2034 | 2035 | Gets or sets cookie value for key 2036 | 2037 | Key 2038 | 2039 | 2040 | 2041 | 2042 | Gets underlying cookie 2043 | 2044 | 2045 | 2046 | 2047 | Hashed password class 2048 | 2049 | 2050 | 2051 | 2052 | True if the supplied argument matches hash 2053 | 2054 | 2055 | 2056 | 2057 | 2058 | 2059 | Gets hash 2060 | 2061 | 2062 | 2063 | 2064 | Gets salt used for hashing 2065 | 2066 | 2067 | 2068 | 2069 | Not thread safe 2070 | 2071 | 2072 | 2073 | 2074 | Register a log, not thread safe 2075 | 2076 | 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | Returns the log matching the name 2083 | 2084 | 2085 | 2086 | 2087 | 2088 | 2089 | Gets the default registered log or the first registered log 2090 | 2091 | 2092 | 2093 | 2094 | Used for checking if a class implements an interface 2095 | 2096 | Interface 2097 | Class Implementing the interface 2098 | 2099 | 2100 | 2101 | 2102 | Returns true if object is specifically of type. 2103 | Use "is" operator to check if an object is an instance of a type that derives from type. 2104 | Returns false is T is nullable 2105 | 2106 | any not nullable Type 2107 | Object 2108 | 2109 | 2110 | 2111 | 2112 | Used for resource localizing 2113 | 2114 | 2115 | If property was not found 2116 | Public static property name 2117 | 2118 | 2119 | 2120 | 2121 | Fast setter. aprox 8x faster than simple Reflection 2122 | 2123 | 2124 | 2125 | 2126 | 2127 | 2128 | Gets the value of a property 2129 | 2130 | Type of property value 2131 | Object to get value from 2132 | Property name 2133 | 2134 | 2135 | 2136 | 2137 | Gets the value of a public property 2138 | 2139 | Object to get value from 2140 | Public property name 2141 | 2142 | 2143 | 2144 | 2145 | Fast getter. aprox 5x faster than simple Reflection, aprox. 10x slower than manual get 2146 | 2147 | 2148 | 2149 | 2150 | 2151 | Gets delegate to quickly create instances of type using public parameterless constructor. 2152 | Use this only when you want to create LOTS of instances (dto scenario) 2153 | 2154 | 2155 | 2156 | 2157 | 2158 | 2159 | Gets the file version of current executing assembly 2160 | 2161 | 2162 | 2163 | 2164 | 2165 | Gets the assembly version 2166 | 2167 | 2168 | 2169 | 2170 | 2171 | This always returns false if the type is taken from an instance. 2172 | That is always use typeof 2173 | 2174 | 2175 | 2176 | 2177 | 2178 | 2179 | Returns the assembly version 2180 | 2181 | 2182 | 2183 | 2184 | 2185 | 2186 | Returns the version of assembly containing type 2187 | 2188 | 2189 | 2190 | 2191 | 2192 | Returns the full name of type, including assembly, i.e: namespace.type, assembly 2193 | 2194 | Type 2195 | 2196 | 2197 | 2198 | 2199 | -------------------------------------------------------------------------------- /packages/CavemanTools.1.4.0.40894/lib/net40/CavemanTools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/CavemanTools.1.4.0.40894/lib/net40/CavemanTools.dll -------------------------------------------------------------------------------- /packages/Dapper.1.9/Dapper.1.9.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.1.9/Dapper.1.9.nupkg -------------------------------------------------------------------------------- /packages/Dapper.1.9/lib/net35/Dapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.1.9/lib/net35/Dapper.dll -------------------------------------------------------------------------------- /packages/Dapper.1.9/lib/net40/Dapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.1.9/lib/net40/Dapper.dll -------------------------------------------------------------------------------- /packages/Dapper.Rainbow.0.1.2/Dapper.Rainbow.0.1.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.Rainbow.0.1.2/Dapper.Rainbow.0.1.2.nupkg -------------------------------------------------------------------------------- /packages/Dapper.Rainbow.0.1.2/lib/net40/Dapper.Rainbow.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.Rainbow.0.1.2/lib/net40/Dapper.Rainbow.dll -------------------------------------------------------------------------------- /packages/Dapper.Rainbow.SQLite.0.1.2/Dapper.Rainbow.SQLite.0.1.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.Rainbow.SQLite.0.1.2/Dapper.Rainbow.SQLite.0.1.2.nupkg -------------------------------------------------------------------------------- /packages/Dapper.Rainbow.SQLite.0.1.2/lib/net40/Dapper.Rainbow.SQLite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Dapper.Rainbow.SQLite.0.1.2/lib/net40/Dapper.Rainbow.SQLite.dll -------------------------------------------------------------------------------- /packages/DapperExtensions.1.3.1/DapperExtensions.1.3.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/DapperExtensions.1.3.1/DapperExtensions.1.3.1.nupkg -------------------------------------------------------------------------------- /packages/DapperExtensions.1.3.1/lib/net40/DapperExtensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/DapperExtensions.1.3.1/lib/net40/DapperExtensions.dll -------------------------------------------------------------------------------- /packages/DapperExtensions.1.3.2/DapperExtensions.1.3.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/DapperExtensions.1.3.2/DapperExtensions.1.3.2.nupkg -------------------------------------------------------------------------------- /packages/DapperExtensions.1.3.2/lib/net40/DapperExtensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/DapperExtensions.1.3.2/lib/net40/DapperExtensions.dll -------------------------------------------------------------------------------- /packages/DapperWrapper.0.3.0.0/DapperWrapper.0.3.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/DapperWrapper.0.3.0.0/DapperWrapper.0.3.0.0.nupkg -------------------------------------------------------------------------------- /packages/DapperWrapper.0.3.0.0/lib/net40/DapperWrapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/DapperWrapper.0.3.0.0/lib/net40/DapperWrapper.dll -------------------------------------------------------------------------------- /packages/HalfOgre.DbExecutor.0.2.0.0/HalfOgre.DbExecutor.0.2.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/HalfOgre.DbExecutor.0.2.0.0/HalfOgre.DbExecutor.0.2.0.0.nupkg -------------------------------------------------------------------------------- /packages/HalfOgre.DbExecutor.0.2.0.0/lib/net40/DbExecutor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/HalfOgre.DbExecutor.0.2.0.0/lib/net40/DbExecutor.dll -------------------------------------------------------------------------------- /packages/Lithium.1.4.2/Lithium.1.4.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Lithium.1.4.2/Lithium.1.4.2.nupkg -------------------------------------------------------------------------------- /packages/Lithium.1.4.2/lib/net40/Lithium.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/Lithium.1.4.2/lib/net40/Lithium.dll -------------------------------------------------------------------------------- /packages/ObjectDumper.1.0.0.12/ObjectDumper.1.0.0.12.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/ObjectDumper.1.0.0.12/ObjectDumper.1.0.0.12.nupkg -------------------------------------------------------------------------------- /packages/ObjectDumper.1.0.0.12/lib/net35-Client/ObjectDumper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/ObjectDumper.1.0.0.12/lib/net35-Client/ObjectDumper.dll -------------------------------------------------------------------------------- /packages/SQLinq.2.0/SQLinq.2.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/SQLinq.2.0/SQLinq.2.0.nupkg -------------------------------------------------------------------------------- /packages/SQLinq.2.0/lib/net/SQLinq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/SQLinq.2.0/lib/net/SQLinq.dll -------------------------------------------------------------------------------- /packages/SQLinq.Dapper.1.2/SQLinq.Dapper.1.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/SQLinq.Dapper.1.2/SQLinq.Dapper.1.2.nupkg -------------------------------------------------------------------------------- /packages/SQLinq.Dapper.1.2/lib/net/SQLinq.Dapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/SQLinq.Dapper.1.2/lib/net/SQLinq.Dapper.dll -------------------------------------------------------------------------------- /packages/SqlFu.1.0.3/SqlFu.1.0.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/SqlFu.1.0.3/SqlFu.1.0.3.nupkg -------------------------------------------------------------------------------- /packages/SqlFu.1.0.3/lib/Net40/SqlFu.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SqlFu 5 | 6 | 7 | 8 | 9 | Prepares sql statement 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Instance of poco is already pushed on the stack 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | returns null if it's not a valid match 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Returns last executed sql with params 35 | 36 | 37 | 38 | 39 | If both poco has id property and the Id arg is specified, the arg is used 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | If both poco has id property and the Id arg is specified, the arg is used 50 | 51 | 52 | 53 | 54 | default is Id 55 | 56 | 57 | 58 | 59 | defaults is true 60 | 61 | 62 | 63 | 64 | Read value and puts it on the stack 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /packages/SqlFu.1.0.3/lib/Net40/SqlFu.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/SqlFu.1.0.3/lib/Net40/SqlFu.dll -------------------------------------------------------------------------------- /packages/jot.skeet.miscutil/MiscUtil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliang/dapper-net-sample/c0c0a4ba0b2478654305a25d982724011548d3a4/packages/jot.skeet.miscutil/MiscUtil.dll -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------