IDomainObjectCollectionData IAssociatableDomainObjectCollection.TransformToAssociated(
            RelationEndPointID endPointID, IAssociatedCollectionDataStrategyFactory associatedCollectionDataStrategyFactory)
        {
            ArgumentUtility.CheckNotNull("endPointID", endPointID);

            var originalDataStrategy = _dataStrategy;

            _dataStrategy = associatedCollectionDataStrategyFactory.CreateDataStrategyForEndPoint(endPointID);
            return(originalDataStrategy);
        }
예제 #2
0
        public DomainObjectCollection GetCollection(RelationEndPointID endPointID)
        {
            ArgumentUtility.CheckNotNull("endPointID", endPointID);
            var collection = _collections.GetOrCreateValue(endPointID, id =>
            {
                var dataStrategy = _dataStrategyFactory.CreateDataStrategyForEndPoint(id);
                return(DomainObjectCollectionFactory.Instance.CreateCollection(id.Definition.PropertyInfo.PropertyType, dataStrategy));
            });

            Assertion.IsTrue(collection.AssociatedEndPointID == endPointID);
            return(collection);
        }