Moon.ORM 4.0 发布
复杂事务支持
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
var t1=DateTime.Now.Ticks;
var tran=DBFactory.DefaultDB.GetOpenDbConnection().BeginTransaction();
var newUser=DBFactory.GetEntity<Administrator>(AdministratorTable.ID.BiggerThan(0),tran);
Console.WriteLine(newUser.Password);
Administrator ad=new Administrator();;
ad.Password=DateTime.Now.ToString();
ad.UserName=DateTime.Now.ToString();
var id=DBFactory.Add(ad,tran);
Console.WriteLine(id);
DBFactory.DeleteWhen(AdministratorTable.ID.BiggerThan(2),tran);
string sql="insert into Administrator([ID],[Password],[UserName]) values('qsmy','33','332')";
DBFactory.DefaultDB.ExecuteOneSql(sql,tran);
Console.WriteLine(tran.Connection.State);
tran.Commit();
var tran=DBFactory.DefaultDB.GetOpenDbConnection().BeginTransaction();
var newUser=DBFactory.GetEntity<Administrator>(AdministratorTable.ID.BiggerThan(0),tran);
Console.WriteLine(newUser.Password);
Administrator ad=new Administrator();;
ad.Password=DateTime.Now.ToString();
ad.UserName=DateTime.Now.ToString();
var id=DBFactory.Add(ad,tran);
Console.WriteLine(id);
DBFactory.DeleteWhen(AdministratorTable.ID.BiggerThan(2),tran);
string sql="insert into Administrator([ID],[Password],[UserName]) values('qsmy','33','332')";
DBFactory.DefaultDB.ExecuteOneSql(sql,tran);
Console.WriteLine(tran.Connection.State);
tran.Commit();
性能提升
性能对比
个别API添加(空字段检测功能,记录条数查询返回Int32)
日志功能
配置日志功能,可以跟踪每一条sql语句
<add key="START_LOG" value="C:\2.TXT"/>
企业开发工具预览(开发中,到时预赠送一批给提出宝贵意见和由评论者中随机抽奖中产生的博友)
少侠,我看你气度不凡天赋异禀,骨骼精奇,这么帅,来了就帮推荐一把吧
我的最近更新