var blog = new ThoughtStream(me); RSS 2.0
 Monday, March 24, 2008

If you are considering the use of NHibernate, or are already using NHibernate, be sure that you always override the .Equals and .GetHashCode methods of your entities. NHibernate makes use of these methods extensively and you are likely to have strange issues if you don't override both of these correctly. Unfortunately, GetHashCode is one of those areas that is difficult to get right; but it needs to be done anyways.

For more information, see:

And one specific note on .Equals: be sure to check ReferencEquals as the last resort, if no other comparison is possible.

I've learned these lessons the hard way; hopefully you won't have to.

Monday, March 24, 2008 2:29:02 PM (Central Standard Time, UTC-06:00)  #    Comments [2]. Trackback 
Tags: .NET | NHibernate

Navigation
About Me
View Derick Bailey's profile on LinkedIn

Send mail to the author(s) Contact Me
Archive
<March 2008>
SunMonTueWedThuFriSat
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Derick Bailey
Sign In
Statistics
Total Posts: 115
This Year: 0
This Month: 0
This Week: 0
Comments: 44
Themes
Pick a theme:
All Content © 2010, Derick Bailey
DasBlog theme 'Business' created by Christoph De Baene (delarou)