Exemplo n.º 1
0
        public bool CollectionTryFindPrimaryKey <TElementType>(Guid elementType, Guid instanceId, bool isScalar, bool isReadOnly, object key, out TElementType value)
        {
            Guid referenceId = Guid.Empty;

            if (collectionInstancesService.TryFindReferenceByKey(instanceId, key, out referenceId))
            {
                value = (TElementType)GetProxyInstance(isReadOnly, referenceId, elementType);
                return(true);
            }
            else
            {
                value = default(TElementType);
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool CollectionContainsPrimaryKey(Guid instanceId, object key, bool isReadOnly)
        {
            Guid referenceId = Guid.Empty;

            if (isReadOnly)
            {
                return(immutableCollectionInstancesService.TryFindReferenceByKey(instanceId, key, out referenceId));
            }
            else
            {
                return(collectionInstancesService.TryFindReferenceByKey(instanceId, key, out referenceId));
            }
        }