public Models.Customer.getComponents setComponents(BusinessObjects.CustomerRecord custRecord) { allComponents = service.getAllComponents(custRecord); Mapper.CreateMap <BusinessObjects.Gender, Models.Customer.Gender>(); Mapper.CreateMap <BusinessObjects.Citizenship, Models.Customer.Citizenship>(); Mapper.CreateMap <BusinessObjects.District, Models.Customer.District>(); Mapper.CreateMap <BusinessObjects.Organization, Models.Customer.Organization>(); Mapper.CreateMap <BusinessObjects.ApplicationType, Models.Customer.ApplicationType>(); Mapper.CreateMap <BusinessObjects.BorrowerType, Models.Customer.BorrowerType>(); Mapper.CreateMap <BusinessObjects.LeadSource, Models.Customer.LeadSource>(); Mapper.CreateMap <BusinessObjects.CivilStatus, Models.Customer.CivilStatus>(); Mapper.CreateMap <BusinessObjects.City, Models.Customer.City>(); Mapper.CreateMap <BusinessObjects.Province, Models.Customer.Province>(); Mapper.CreateMap <BusinessObjects.HomeOwnership, Models.Customer.HomeOwnership>(); Mapper.CreateMap <BusinessObjects.BusinessType, Models.Customer.BusinessType>(); Mapper.CreateMap <BusinessObjects.NatureofBusiness, Models.Customer.NatureofBusiness>(); Mapper.CreateMap <BusinessObjects.AddressType, Models.Customer.AddressType>(); Mapper.CreateMap <BusinessObjects.RelationshipType, Models.Customer.RelationshipType>(); Mapper.CreateMap <BusinessObjects.EducationType, Models.Customer.EducationType>(); Mapper.CreateMap <BusinessObjects.Agent, Models.Customer.Agent>(); Mapper.CreateMap <BusinessObjects.getComponents, Models.Customer.getComponents>(); Models.Customer.getComponents list = new Models.Customer.getComponents(); list = Mapper.Map <BusinessObjects.getComponents, Models.Customer.getComponents>(allComponents); return(list); }