private static BuildingComplex CreateNewComplex([NotNull][ItemNotNull] List <BuildingComplex> komplexe, ref int virtualEGIDs, KeyValuePair <string, string> localnetStandort,
                                                        [NotNull] string manuallytranslatedAdress, int gebäudeID)
        {
            var newbc = new BuildingComplex(Guid.NewGuid().ToString(), BuildingComplex.SourceOfEntry.Localnetdata);

            newbc.ObjektStandorte.Add(localnetStandort.Value);
            newbc.AddAdress(manuallytranslatedAdress);
            newbc.EGids.Add(virtualEGIDs--);
            newbc.GebäudeObjectIDs.Add(gebäudeID);
            komplexe.Add(newbc);
            return(newbc);
        }
        private static void PerformActualComplexMerge([NotNull] BuildingComplex c2, [NotNull] BuildingComplex c1, [NotNull] Database dbComplex)
        {
            foreach (var c2EGid in c2.EGids)
            {
                if (!c1.EGids.Contains(c2EGid))
                {
                    c1.EGids.Add(c2EGid);
                }
            }

            foreach (var c2Adress in c2.Adresses)
            {
                if (!c1.Adresses.Contains(c2Adress))
                {
                    c1.AddAdress(c2Adress);
                }
            }

            foreach (var c2Coord in c2.Coords)
            {
                if (!c1.Coords.Contains(c2Coord))
                {
                    c1.AddCoord(c2Coord);
                }
            }

            foreach (var c2Coord in c2.LocalnetCoords)
            {
                if (!c1.LocalnetCoords.Contains(c2Coord))
                {
                    c1.AddLocalCoord(c2Coord);
                }
            }

            foreach (var c2ID in c2.GebäudeObjectIDs)
            {
                if (!c1.GebäudeObjectIDs.Contains(c2ID))
                {
                    c1.AddGebäudeID(c2ID);
                }
            }

            foreach (var c2ID in c2.ObjektStandorte)
            {
                if (!c1.ObjektStandorte.Contains(c2ID))
                {
                    c1.ObjektStandorte.Add(c2ID);
                }
            }

            foreach (var c2Tk in c2.TrafoKreise)
            {
                if (!c1.TrafoKreise.Contains(c2Tk))
                {
                    c1.TrafoKreise.Add(c2Tk);
                }
            }

            dbComplex.Save(c1);
            dbComplex.Delete(c2);
        }