Exemple #1
0
        private void AddStaffAddress(StaffAddressDto staffAddressDto, Staff staff)
        {
            var addressType         = _mappingHelper.MapLookupField <StaffAddressType> (staffAddressDto.StaffAddressType);
            var countyAreaLookup    = _mappingHelper.MapLookupField <CountyArea> (staffAddressDto.CountyArea);
            var stateProvinceLookup = _mappingHelper.MapLookupField <StateProvince> (staffAddressDto.StateProvince);

            var staffAddress =
                new StaffAddressBuilder().WithStaffAddressType(addressType).WithAddress(
                    new AddressBuilder().WithFirstStreetAddress(staffAddressDto.FirstStreetAddress).WithSecondStreetAddress(
                        staffAddressDto.SecondStreetAddress).WithCityName(staffAddressDto.CityName).WithCountyArea(countyAreaLookup)
                    .WithStateProvince(stateProvinceLookup).WithPostalCode(new PostalCode(staffAddressDto.PostalCode)));

            staff.AddAddress(staffAddress);
        }