public static IVirtualEndPoint CreateVirtualEndPoint(this IRelationEndPointFactory endPointFactory, RelationEndPointID endPointID, bool markDataComplete) { ArgumentUtility.CheckNotNull("endPointID", endPointID); if (!endPointID.Definition.IsVirtual) { throw new ArgumentException("The RelationEndPointID must identify a virtual end-point.", "endPointID"); } if (endPointID.Definition.Cardinality == CardinalityType.One) { var virtualObjectEndPoint = endPointFactory.CreateVirtualObjectEndPoint(endPointID); if (markDataComplete) { virtualObjectEndPoint.MarkDataComplete(null); } return(virtualObjectEndPoint); } else { var collectionEndPoint = endPointFactory.CreateCollectionEndPoint(endPointID); if (markDataComplete) { collectionEndPoint.MarkDataComplete(new DomainObject[0]); } return(collectionEndPoint); } }
public IVirtualObjectEndPoint CreateVirtualObjectEndPoint(RelationEndPointID endPointID) { var endPoint = _innerFactory.CreateVirtualObjectEndPoint(endPointID); return(new StateUpdateRaisingVirtualObjectEndPointDecorator(endPoint, _listener)); }