TransactionalNodeService.Common.NodeService.CreateNodeCommand C# (CSharp) Method

CreateNodeCommand() protected method

protected CreateNodeCommand ( System.Guid &newNodeId, string nodeOriginalId = default(string), System.Guid nodeTypeUid = default(Guid), System.Guid domainUid = default(Guid) ) : SqlCommand
newNodeId System.Guid
nodeOriginalId string
nodeTypeUid System.Guid
domainUid System.Guid
return System.Data.SqlClient.SqlCommand
        protected SqlCommand CreateNodeCommand(out Guid newNodeId, string nodeOriginalId = default(string), Guid nodeTypeUid = default(Guid), Guid domainUid = default(Guid))
        {
            SqlCommand createNodeCommand = new SqlCommand();
            createNodeCommand.CommandText = "INSERT INTO [Nodes] ([NodeUid], [NodeOriginalId], [NodeTypeUid], [DomainUid]) VALUES (@NodeUid, @NodeOriginalId, @NodeTypeUid, @DomainUid)";
            createNodeCommand.Connection = Connection;

            newNodeId = Guid.NewGuid();

            createNodeCommand.Parameters.AddWithValue("@NodeUid", newNodeId);

            if (nodeOriginalId != default(string))
            {
                createNodeCommand.Parameters.AddWithValue("@NodeOriginalId", nodeOriginalId);
            }

            if (nodeTypeUid != default(Guid))
            {
                createNodeCommand.Parameters.AddWithValue("@NodeTypeUid", nodeTypeUid);
            }

            if (domainUid != default(Guid))
            {
                createNodeCommand.Parameters.AddWithValue("@DomainUid", domainUid);
            }

            return createNodeCommand;
        }