public DomainObject GetObjectReference(ObjectID objectID) { ArgumentUtility.CheckNotNull("objectID", objectID); if (_invalidDomainObjectManager.IsInvalid(objectID)) { return(_invalidDomainObjectManager.GetInvalidObjectReference(objectID)); } var enlistedObject = _enlistedDomainObjectManager.GetEnlistedDomainObject(objectID); if (enlistedObject != null) { return(enlistedObject); } var creator = objectID.ClassDefinition.InstanceCreator; var initializationContext = new ObjectReferenceInitializationContext( objectID, _clientTransaction.RootTransaction, _enlistedDomainObjectManager); return(creator.CreateObjectReference(initializationContext, _clientTransaction)); }
public ILoadedObjectData GetLoadedObject(ObjectID objectID) { ArgumentUtility.CheckNotNull("objectID", objectID); if (_invalidDomainObjectManager.IsInvalid(objectID)) { return(new InvalidLoadedObjectData(_invalidDomainObjectManager.GetInvalidObjectReference(objectID))); } var dataContainer = _loadedDataContainerProvider.GetDataContainerWithoutLoading(objectID); return(dataContainer != null ? new AlreadyExistingLoadedObjectData(dataContainer) : null); }
public override IInvalidDomainObjectManager CreateInvalidDomainObjectManager( ClientTransaction constructedTransaction, IClientTransactionEventSink eventSink) { ArgumentUtility.CheckNotNull("constructedTransaction", constructedTransaction); ArgumentUtility.CheckNotNull("eventSink", eventSink); var invalidObjects = _parentInvalidDomainObjectManager.InvalidObjectIDs.Select(id => _parentInvalidDomainObjectManager.GetInvalidObjectReference(id)); var parentDataManager = _parentTransaction.DataManager; var deletedObjects = parentDataManager.DataContainers.Where(dc => dc.State == StateType.Deleted).Select(dc => dc.DomainObject); return(new InvalidDomainObjectManager(eventSink, invalidObjects.Concat(deletedObjects))); }