Beispiel #1
0
        public DataContainer GetDataContainerWithLazyLoad(ObjectID objectID, bool throwOnNotFound)
        {
            ArgumentUtility.CheckNotNull("objectID", objectID);

            // GetDataContainerWithoutLoading guards against invalid IDs.
            var dataContainer = GetDataContainerWithoutLoading(objectID);

            if (dataContainer != null)
            {
                return(dataContainer);
            }

            _objectLoader.LoadObject(objectID, throwOnNotFound);

            // Since LoadObjects might have marked IDs as invalid, we need to use DataContainers[...] instead of GetDataContainerWithoutLoading here.
            return(DataContainers[objectID]);
        }
Beispiel #2
0
 public ILoadedObjectData LoadObject(ObjectID id, bool throwOnNotFound)
 {
     ++NumberOfCallsToLoadObject;
     return(_decorated.LoadObject(id, throwOnNotFound));
 }