TransactionalNodeService.AddRelationshipTransactionOperation.CreateDescriptor C# (CSharp) Method

CreateDescriptor() protected method

protected CreateDescriptor ( System.Guid &newDescriptorUid, SoapDescriptorType descriptorType, TransactionToken nodeUid, System.Guid relationshipUid ) : SqlCommand
newDescriptorUid System.Guid
descriptorType SoapDescriptorType
nodeUid TransactionToken
relationshipUid System.Guid
return System.Data.SqlClient.SqlCommand
        protected SqlCommand CreateDescriptor(out Guid newDescriptorUid, SoapDescriptorType descriptorType, TransactionToken nodeUid, Guid relationshipUid)
        {
            SqlCommand createDescriptorCommand = new SqlCommand();
            createDescriptorCommand.CommandText = "INSERT INTO dbo.[Descriptors] (DescriptorUid, DescriptorTypeUid, NodeUid, RelationshipUid) VALUES (@DescriptorUid, @DescriptorTypeUid, @NodeUid, @RelationshipUid)";
            createDescriptorCommand.Connection = Connection;

            newDescriptorUid = Guid.NewGuid();

            createDescriptorCommand.Parameters.AddWithValue("@DescriptorUid", newDescriptorUid);
            createDescriptorCommand.Parameters.AddWithValue("@DescriptorTypeUid", descriptorType.Id);
            createDescriptorCommand.Parameters.AddWithValue("@NodeUid", nodeUid.GetValue());
            createDescriptorCommand.Parameters.AddWithValue("@RelationshipUid", relationshipUid);

            return createDescriptorCommand;
        }
    }