static void CreateParty()
        {
            // Create the root object and set the connection string
            BtsCatalogExplorer catalog = new BtsCatalogExplorer();

            catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI";

            try
            {
                // Create a party
                Party myParty = catalog.AddNewParty();
                myParty.Name = "FedEx";
                // create a standard alias
                PartyAlias standardAlias = myParty.AddNewAlias();
                standardAlias.Name  = "D-U-N-S (Dun & Bradstreet)";
                standardAlias.Value = "Value1";

                // Create a custom alias
                PartyAlias customAlias = myParty.AddNewAlias();
                customAlias.Name      = "Telephone";
                customAlias.Qualifier = "100";
                customAlias.Value     = "4257076302";

                // Add party send ports
                myParty.SendPorts.Add(catalog.SendPorts["NormalDelivery"]);
                myParty.SendPorts.Add(catalog.SendPorts["ExpressDelivery"]);

                // Specify a signature certificate, make sure the certificate is available
                // in the AddressBook store of the Local Machine
                foreach (CertificateInfo certificate in catalog.Certificates)
                {
                    if (certificate.ShortName == "BR, Certisign Certificadora Digital Ltda., Certisign - Autoridade Certificadora - AC2")
                    {
                        myParty.SignatureCert = certificate;
                        break;
                    }
                }

                // Commit the changes
                catalog.SaveChanges();
            }
            catch (Exception e)
            {
                catalog.DiscardChanges();
                throw e;
            }
        }