Hello
I am using some NHibernate 1.2 code with NHibernate 2.0 and its giving me an issue with this line:
return (TId) entityMeta.GetIdentifier(entity);
its asking me to add EntityMode: POCO, Map or Xml
return (TId) entityMeta.GetIdentifier(entity, EntityMode.Map);
But which mode is the correct one to use?
Here is the whole method:
public TId GetId<TId>(TEntity entity)
{
ISessionFactory sessionFactory = NHibernateSessionManager.Instance.GetSessionFactoryFor(assembly);
if (sessionFactory == null)
{
sessionFactory = NHibernateSessionManager.Instance.GetSessionFactoryFor(GetNHibernateConfig());
}
IClassMetadata entityMeta = sessionFactory.GetClassMetadata(typeof(TEntity));
return (TId) entityMeta.GetIdentifier(entity, EntityMode.Map);
}