/// <summary> /// Handles schema compare save SCMP request /// </summary> /// <returns></returns> public async Task HandleSchemaCompareSaveScmpRequest(SchemaCompareSaveScmpParams parameters, RequestContext <ResultStatus> requestContext) { try { ConnectionInfo sourceConnInfo; ConnectionInfo targetConnInfo; ConnectionServiceInstance.TryFindConnection(parameters.SourceEndpointInfo.OwnerUri, out sourceConnInfo); ConnectionServiceInstance.TryFindConnection(parameters.TargetEndpointInfo.OwnerUri, out targetConnInfo); CurrentSchemaCompareTask = Task.Run(async() => { SchemaCompareSaveScmpOperation operation = null; try { operation = new SchemaCompareSaveScmpOperation(parameters, sourceConnInfo, targetConnInfo); operation.Execute(parameters.TaskExecutionMode); await requestContext.SendResult(new ResultStatus() { Success = true, ErrorMessage = operation.ErrorMessage, }); } catch (Exception e) { Logger.Write(TraceEventType.Error, "Failed to save scmp file. Error: " + e); await requestContext.SendResult(new SchemaCompareResult() { OperationId = operation != null ? operation.OperationId : null, Success = false, ErrorMessage = operation == null ? e.Message : operation.ErrorMessage, }); } }); } catch (Exception e) { await requestContext.SendError(e); } }