private void SetupReferenceData() { var countries = new Country { CountryId = "1", Name = "USA", Code = "USA" }; var states = new State { StateId = "2", CountryId = "1", Name = "Florida" }; var ports = new Port { PortId = "1", City = "Florida", Name = "Miami", State = "Florida", StateId = "2", CountryId = "1" }; var brands = new Brand { BrandId = "1", Name = "Carnival" }; var personTypes = new PersonTypeEntity { PersonTypeId = "1001", Name = "Daniel" }; var loyaltyLevelTypes = new LoyaltyLevelType { LoyaltyLevelTypeId = "1001", Name = "abc", BrandId = "1", NoOfCruiseNights = 3, LogoImageAddress = "abc" }; var documentType = new DocumentType { CountryId = "232", Code = "USA", DocumentTypeId = "1", Name = "Passport" }; var brand = new BrandCollection(); var country = new CountryCollection(); country.Add(countries); var state = new StateCollection(); state.Add(states); var documentTypes = new DocumentTypeCollection(); documentTypes.Add(documentType); var port = new PortCollection(); port.Add(ports); var personTypeEntity = new PersonTypeEntityCollection(); personTypeEntity.Add(personTypes); var loyaltyLevelType = new LoyaltyLevelTypeCollection(); loyaltyLevelType.Add(loyaltyLevelTypes); this.referenceData.AssignBrands(brand); this.referenceData.AssignCountries(country); this.referenceData.AssignStates(state); this.referenceData.AssignDocumentTypes(documentTypes); this.referenceData.AssignLoyaltyLevelTypes(loyaltyLevelType); this.referenceData.AssignPersonTypes(personTypeEntity); this.referenceData.AssignPorts(port); }
/// <summary> /// Maps the person types. /// </summary> /// <param name="dataReader">The data reader.</param> /// <returns>Person types.</returns> private static async Task<PersonTypeEntityCollection> MapPersonTypes(SqlDataReader dataReader) { var personTypeEntityCollection = new PersonTypeEntityCollection(); if (dataReader != null) { while (await dataReader.ReadAsync()) { var personTypeEntity = new PersonTypeEntity { PersonTypeId = dataReader.Int32Field(PersonTypeId).ToString(), Name = dataReader.StringField(Name) }; personTypeEntityCollection.Add(personTypeEntity); } } return personTypeEntityCollection; }