Hi
I have a problem with Nhibernate, lazy loading and the JavaScriptSerializer that comes as part of the Ajax toolkit.
If I load an object which is marked as Lazy using something like session.load as in below:
Code:
session.Load<Type>(id);
Then it will not serialize due to a circular reference.
But if I use the code:
Code:
ISession session = _sessionManager.OpenSession();
string hql = string.Format("from {0} t where t.Uid = :uid", typeof(T).Name);
IQuery query = session.CreateQuery(hql);
query.SetGuid("uid", uid);
return query.UniqueResult<T>();
Then all is good. I am taking a performance hit on this and would like to be able to serialize proxied objects.
Is this possible or are there any steps I can take to help me achieve serialization?
has anybody been through this?
Cheers
Paul