--运行SQL语句
--参数1:SQL语句
--参数2:参数
--参数3:数据库名称
ORM.RunSql<T>("select * from tblTest where username = @username", new { username = "fanrong" }, EDataBase.数据库名称.ToString());
3.2.0.0 版本新增【链式语法】:
ORM.Build<T>()
.RunSql("select * from tblTest where username = @username", new { username = "fanrong" })
.ToList();
--分页写法
--参数3:页码
--参数4:行数
ORM.RunSql<T>("select * from tblTest where username = @username", new { username = "fanrong" }, 1, 10, EDataBase.数据库名称.ToString());
3.2.0.0 版本新增【链式语法】:
ORM.Build<T>()
.RunSql("select * from tblTest where username = @username", new { username = "fanrong" })
.ToPageList(1, 10);
--参数的2种写法
--1:
new { username = "fanrong" }
--2:
var list = new List<MDynamicParameter>();
list.Add("@username", "fanrong");