I am using NHibernate and this error appears when I use Get method of Session.
This is my code:
public T GetById(object id)
{
T entity;
entity = (T)ReportHttpModule.CurrentSession.Get(typeof(T), id);
return entity;
}
note that I don't get this error when use CreateCriteria(T)
before calling that method!