예제 #1
0
        public static async Task AddContacts(int CustomerCount)
        {
            IEnumerable <CustomerData> customers = RandomCustomerGenerator.GetCustomerList(CustomerCount, false);

            foreach (CustomerData customer in customers)
            {
                Contact newContact = new Contact {
                    firstname                = customer.FirstName,
                    lastname                 = customer.LastName,
                    emailaddress1            = customer.EmailAddress,
                    company                  = customer.Company,
                    telephone1               = customer.WorkPhone,
                    mobilephone              = customer.HomePhone,
                    address1_line1           = customer.Address,
                    address1_city            = customer.City,
                    address1_stateorprovince = customer.State,
                    address1_postalcode      = customer.ZipCode
                };

                await CdsaManager.AddContact(newContact);
            }
        }