private byte[] CreateDbaseRecord(BuildingUnitSyndicationContent buildingUnit, AddressLinkSyndicationItem address, SyndicationContext context)
        {
            var record = new AddressLinkDbaseRecord
            {
                objecttype = { Value = "Gebouweenheid" },
                adresobjid = { Value = string.IsNullOrEmpty(buildingUnit.Identificator.ObjectId) ? "" : buildingUnit.Identificator.ObjectId },
            };

            if (address != null)
            {
                if (!string.IsNullOrEmpty(address.PersistentLocalId))
                {
                    record.adresid.Value = Convert.ToInt32(address.PersistentLocalId);
                }

                record.voladres.Value = CreateCompleteAddress(address, context);
            }

            return(record.ToBytes(_encoding));
        }
        private async Task <AddressBuildingUnitLinkExtractItem> CreateAddressBuildingUnitLinkExtractItem(AtomEntry <SyndicationItem <Building> > entry, Guid addressId, BuildingUnitSyndicationContent buildingUnit, SyndicationContext context)
        {
            var address = await context.AddressLinkAddresses.FindAsync(addressId);

            var dbaseRecord = CreateDbaseRecord(buildingUnit, address, context);

            return(new AddressBuildingUnitLinkExtractItem
            {
                AddressId = addressId,
                BuildingId = entry.Content.Object.Id,
                BuildingUnitPersistentLocalId = buildingUnit.Identificator.ObjectId,
                BuildingUnitId = buildingUnit.BuildingUnitId,
                DbaseRecord = dbaseRecord, //Add address info
                AddressComplete = address?.IsComplete ?? false,
                AddressPersistentLocalId = address?.PersistentLocalId,
            });
        }