NHibernate: Get vs Load

If Load() can’t find the object in the cache or database, an exception is thrown. The Load() method never returns null.

The Get() method returns null if the object can’t be found.

Advertisements

POCO and NHibernate

Some requirements to use POCO within NHibernate

  1. NHibernate requires a default constructor (parameterless constructor) for every persistent class (it should be at least protected if runtime generated proxies will be used)
  2. Serializable is not required