Exemple #1
0
        public void LoadLazyCollectionEndPoint(RelationEndPointID endPointID)
        {
            ArgumentUtility.CheckNotNull("endPointID", endPointID);

            var collectionEndPoint = GetRelationEndPointWithoutLoading(endPointID) as ICollectionEndPoint;

            if (collectionEndPoint == null)
            {
                throw new ArgumentException("The given ID does not identify an ICollectionEndPoint managed by this DataManager.", "endPointID");
            }

            if (collectionEndPoint.IsDataComplete)
            {
                throw new InvalidOperationException("The given end-point cannot be loaded, its data is already complete.");
            }

            var loadedData    = _objectLoader.GetOrLoadRelatedObjects(endPointID);
            var domainObjects = loadedData.Select(data => data.GetDomainObjectReference()).ToArray();

            collectionEndPoint.MarkDataComplete(domainObjects);
        }
Exemple #2
0
 public ICollection <ILoadedObjectData> GetOrLoadRelatedObjects(RelationEndPointID relationEndPointID)
 {
     return(_decorated.GetOrLoadRelatedObjects(relationEndPointID));
 }