Dapper是近2年异军突起的新ORM工具,它有ado.net般的高性能又有反射映射实体的灵活性,非常适合喜欢原生sql的程序员使用,而且它源码很小,十分轻便.我写本博客的目的不是为了介绍Dapper,而是要将我使用Dapper迁移数据库过程中遇到的bug和一些优化介绍给大家,Dapper在多数据库支持上有些问题,我做了以下5个方面的优化. 一:Dapper核心库存在一个重要的bug是各数据库默认返回类型不同造成的,像count,sum等一些函数在不同的数据库返回类型不同.比如 select c
基于Dapper二次封装了一个易用的ORM工具类:SqlDapperUtil,把日常能用到的各种CRUD都进行了简化封装,让普通程序员只需关注业务即可,因为非常简单,故直接贴源代码,大家若需使用可以直接复制到项目中,该SqlDapperUtil已广泛用于公司项目中. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
ORM TipsORM小窍门 More and more people are using Object to Relational Mapping (ORM) tools to jump the divide between application code that is object oriented and a database that is storing information in a relational manner. These tools are excellent an