Esempio n. 1
0
        public OperationResult <TestServicePartitionInfo[]> ConvertToServicePartitionResult(NativeTypes.FABRIC_ERROR_CODE errorCode, ResolvedServicePartition resolvedPartition)
        {
            OperationResult <TestServicePartitionInfo[]> result = FabricClientState.CreateOperationResultFromNativeErrorCode <TestServicePartitionInfo[]>(errorCode);

            if (resolvedPartition != null)
            {
                // Store ResolvedServicePartition object when the users need to call apis on this object
                int id = this.PartitionHolder.StoreObject(resolvedPartition);
                result = FabricClientState.Convert(resolvedPartition, id);
            }

            return(result);
        }
Esempio n. 2
0
        public static OperationResult <TestServicePartitionInfo[]> Convert(ResolvedServicePartition resolvedServicePartition, int partitionIdentifierNumber)
        {
            OperationResult <TestServicePartitionInfo[]> result = null;

            if (resolvedServicePartition != null)
            {
                List <TestServicePartitionInfo> partitionInfos = new List <TestServicePartitionInfo>();

                foreach (ResolvedServiceEndpoint resolvedEndpoint in resolvedServicePartition.Endpoints)
                {
                    partitionInfos.Add(FabricClientState.Convert(resolvedServicePartition, resolvedEndpoint, partitionIdentifierNumber));
                }

                result = FabricClientState.CreateOperationResultFromNativeErrorCode <TestServicePartitionInfo[]>(partitionInfos.ToArray());
            }

            return(result);
        }