public void InsertEntityGraphSingles() { var debugToken = "InsertEntityGraphSingles()"; Entity myNewEntity = new Entity { Type = 0, SecurityType = 1, DebugToken = debugToken }; EntityName myNewEntityName = new EntityName { First = "joe", Last = "blow", Type = 0, DebugToken = debugToken }; EntityAddress myNewEntityAddress = new EntityAddress { Address1 = "addy1", City = "MyCity", State = "MyState", PostalCode = "12345", Country = "whoknows", Type = 0 }; EntityPhone myNewEntityPhone = new EntityPhone { Type = 0, Phone = "1112223333" }; EntityEmail myNewEntityEmail = new EntityEmail { Type = 0, Email = "*****@*****.**" }; EntityCreditCard myNewEntityCreditCard = new EntityCreditCard { Type = 0, CC = "123", Code = 123, ExpirationMonth = "2", ExpirationYear = "2017" }; EntitySocialMedia myNewEntitySocialMedia = new EntitySocialMedia { Type = 0, Url = "somethingcool.com", Login = "******", PW = "pw" }; myNewEntity.Names.Add(myNewEntityName); myNewEntity.Addresses.Add(myNewEntityAddress); myNewEntity.Phones.Add(myNewEntityPhone); myNewEntity.Emails.Add(myNewEntityEmail); myNewEntity.CreditCards.Add(myNewEntityCreditCard); myNewEntity.SocialMedia.Add(myNewEntitySocialMedia); SaveEntityChanges(myNewEntity); }
public void InsertEntityAndPhone() { var debugToken = "InsertEntityAndPhone()"; Entity myNewEntity = new Entity { Type = 0, SecurityType = 1, DebugToken = debugToken }; EntityPhone myNewEntityPhone = new EntityPhone { Type = 0, Phone = "1112223333" }; myNewEntity.Phones.Add(myNewEntityPhone); SaveEntityChanges(myNewEntity); }