Geeks With Blogs


Len Smith's Facebook profile

nIgnuSharp.NET //len smith is a software developer in ann arbor, mi February 2008 Entries
A Few NHibernate Gotchas
Some things to watch out for when working with NHibernate... If you update an NHibernate entity without detaching it first from the session, it will be updated automatically. [Test] public void UpdatedEntityPropertyWillSa... { Customer customer = null; try { customer = _Repository.GetFirst(); customer.FirstName = null; // First Name can not be null, so this will throw an exception _Repository.Flush(); // flush happens also when the session ends. } catch(Exception ex) { Assert.That(ex.InnerException ......

Posted On Thursday, February 21, 2008 11:33 AM

Copyright © Len Smith | Powered by: