diff --git a/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs index a8503879..4dd35d79 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs @@ -550,8 +550,14 @@ public sealed class EntitySerializer }) .ToList(); - // Instances: resolve template + site by name/identifier. Areas don't travel - // (see export TODO), so AreaId stays null. Connection bindings keep their + // Instances: resolve template + site by name/identifier. Areas DO travel — + // by NAME on InstanceDto.AreaName (export resolves AreaId→AreaNameById; the + // importer resolves-or-creates the area under the target site). This helper + // still materializes AreaId = null for the same reason the connection-binding + // FK below is a placeholder: FromBundleContent is NOT on the importer's path + // (BundleImporter walks the raw DTO) and has no target-DB name→id map to + // resolve against. Round-trip fidelity for the area lives on the DTO, not on + // this materialized entity. Connection bindings keep their // resolved DataConnection NAME on the wire DTO — the importer reads // bindings from BundleContentDto.Instances[].ConnectionBindings directly and // resolves ConnectionName→the target environment's DataConnectionId at apply