This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
What I mean is, if I have a instance if an entity, some related enities may not have been loaded yet? If I try to access them I get an ObjectDisposedException error. Is there a property I can check to see if the related entity has been loaded yet, and hence prevent this error being raised in the first place.
|
|
|
Yes. Both EntityHolder<T> and EntityCollection<T> have an IsLazy property. This will be false if the association has been loaded, true if it has not been loaded. Note that accessing an association property causes the association to be loaded (because the generated property getter calls the Get method). You'll therefore need to add your own properties to expose the info you want without calling Get method on the EntityHolder/EntityCollection e.g. public bool IsParentLoaded { get { return !_parent.IsLazy; } } |
|