为什么下面这段代码中的Persist方法,每次都立即在SQL Server中执行Insert语句?我用的是Nhibernate3.2 [TestMethod] public void oneToManyTest() { Customer c1 = _session.Get<Customer>(1);; for (int i = 0; i < 13; i++) { Order o = new Order() { Customer = c1, OrderDate = DateTime.Now}; c1.Orders.Add(o); _session.Persist(o); } _session.Flush(); }
- 2 回答
- 0 关注
- 190 浏览
添加回答
举报
0/150
提交
取消