private void loadContactAddressTypes() { using (var context = new Entities()) { var AddressTypes = new Repository.PersonRepository.AddressType(context); var addressTypes = AddressTypes.addressTypes().ToList(); this.personAddressType.DataSource = addressTypes; } this.personAddressType.DisplayMember = "Name"; this.personAddressType.ValueMember = "AddressTypeID"; }
public void getIEnumberableOfAddressType() { var context = new Entities(); Repository.PersonRepository.AddressType addressType = new Repository.PersonRepository.AddressType(context); var items = addressType.addressTypes().ToList(); //returns IEnumberable<AdventureWorks.Model.Person> and prints values in model. foreach (var item in items) { if (!item.Equals("Billing")) { continue; } Assert.AreEqual("Billing", item.Name); } }