我有這個功能NHibernate的更新
- 總是返回true,但問題是,它修改表的用戶,但它不修改表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; }
您可以通過它讀取啓動。我們不是活編譯器。然後你可以發佈你的NH映射。 – Artless
良好的評論感謝 – developper
現在你能回答@Trickery – developper