1. Why Choose Dapper
1) Light weight.
2) fast speed. The speed of the dapper is close to the IDataReader, and the data for the list exceeds the DataTable.
3) support multiple databases. Dapper can work with all ADO providers, including SQLite, SqlCe, Firebird, Oracle, MySQL, PostgreSQL and SQL Server
4) can map one-to-one, one-to-many, many-to-many relationships.
5) High performance. By emit reflection IDataReader sequence queue, to quickly get and produce objects, performance is good.
6) Support framework2.0,3.0,3.5,4.0,4.5
7) Dapper syntax is very simple. And no need to compromise the design of the database
2. Using tutorials
1) Add a connection string to the configuration file, Web. config
<connectionStrings> <add name= "sqlconnectionstring" connectionstring= "server=127.0.0.1;database= MyDataBase; user=sa;password=123456; Connect timeout=1000000 "/> <add name=" mysqlconnectionstring "connectionstring=" Database=hyd;data Source= 127.0.0.1; User Id=root; Password=root; charset=utf8;port=3306 "/> </connectionStrings>
2)
ORM Dapper operation of SQL Server and MySQL database