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); }
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); }