我有这个功能
- 它总是返回 true 但问题是它修改了表 User 但它没有修改表 Useracl
如何更正此代码?
try { NHibernate.ISession nhSession= User.OpenSession(); using (var tx = nhSession.BeginTransaction()) { User u = new User() { Account = acc, Identification = identification, ContactEmail = mail, ContactName = nom, ContactPhone = phone, NotifyEmail = notify, Password = mot }; nhSession.SaveOrUpdate(u); Useracl ua = new Useracl { Account = acc, UserID = identification, AccessLevel = 1, AclID = acc }; nhSession.SaveOrUpdate(ua); tx.Commit(); return true; } } catch { return false; }