public static void Export_RelationAnalysis(AErgRelationen aErg)
        {
            string fileContent = "";

            fileContent += $"Referentiellen Integritäten" + Environment.NewLine;
            fileContent += $"" + Environment.NewLine;
            fileContent += $"" + Environment.NewLine;

            fileContent += $"Dokumentiert" + Environment.NewLine;
            foreach (PossibleReference _dri in aErg.DocumentedReferences)
            {
                fileContent += $"Referenz;{_dri.PK_Relation.Relation} {{";
                foreach (string _a in _dri.PK_Relation.Attributes)
                {
                    fileContent += $"{_a},";
                }
                fileContent += $"}};";

                fileContent += $"referenziert von;{_dri.FK_Relation} {{";
                foreach (string _a in _dri.FK_Attributes)
                {
                    fileContent += $"{_a},";
                }
                fileContent += $"}}" + Environment.NewLine;

                fileContent += $"Statistik;{_dri.Childless} Kinderlose, {_dri.Parents} Eltern, {_dri.Orphans} Waisen" + Environment.NewLine;

                fileContent += $"" + Environment.NewLine;
            }


            fileContent += $"" + Environment.NewLine;
            fileContent += $"Identifizierte" + Environment.NewLine;
            fileContent += $"" + Environment.NewLine;

            foreach (PossibleReference _dri in aErg.FoundReferences)
            {
                fileContent += $"Referenz;{_dri.PK_Relation.Relation} {{";
                foreach (string _a in _dri.PK_Relation.Attributes)
                {
                    fileContent += $"{_a},";
                }
                fileContent += $"}};";

                fileContent += $"referenziert von;{_dri.FK_Relation} {{";
                foreach (string _a in _dri.FK_Attributes)
                {
                    fileContent += $"{_a},";
                }
                fileContent += $"}}" + Environment.NewLine;

                fileContent += $"Statistik;{_dri.Childless} Kinderlose, {_dri.Parents} Eltern, {_dri.Orphans} Waisen" + Environment.NewLine;

                fileContent += $"" + Environment.NewLine;
            }

            Export_AErgObject(aErg, fileContent);
        }
        private static void RelationenAnalyse()
        {
            LogHelper.LogApp($"{MethodBase.GetCurrentMethod().Name}");

            //Reformat
            foreach (var _a in TupelAnalyse_Results)
            {
                TupelAnalyse_Result_Sort.Add(_a.Relation, _a);
            }

            RelationenAnalysis_Result = DPRelationen.Analysis(Database);
        }
        public static AErgRelationen Analysis(string Database)
        {
            AErgRelationen _Ret = new AErgRelationen(Database);

            _Ret.DocumentedReferences = DPRelationen_Helper.Get_DocumentedReferences();

            Dictionary <string, PossibleKey> RelationsWithKeys = DPRelationen_Helper.Find_RelationsWithKeys();
            int _i = 0;

            //Primary Key required for Foreign Key
            if (RelationsWithKeys.Count > 0)
            {
                _Ret.FoundReferences = new List <PossibleReference>();
                foreach (string _r in RelationsWithKeys.Keys)
                {
                    LogHelper.LogApp($"{MethodBase.GetCurrentMethod().Name} - {_i}/{RelationsWithKeys.Count} - {_r}");

                    //Only test keys with 1 Attribute - - Double cross to complex
                    if (RelationsWithKeys[_r].Attributes.Count == 1)
                    {
                        string _a = RelationsWithKeys[_r].Attributes.First();
                        ColumnBasicProperties _a_p = DPRelationen_Helper.Get_ColumnBasicProps(_r, _a);
                        int _j = 0, _v = 0;
                        Dictionary <string, List <string> > _a_similar = DPRelationen_Helper.Get_SimilarColumns(_a_p);
                        _a_similar.Remove(_r);

                        /*Filter out unfitting*/
                        //_a_similar = DPRelationen_Helper.Remove_MinMax(_a_similar, DPAnalysis.AttributAnalyse_Results_Sort[_r][_a]);
                        //Not used because valid Orphans could be included in this

                        foreach (string __r in _a_similar.Keys)
                        {
                            _v = 0;
                            foreach (string __a in _a_similar[__r])
                            {
                                LogHelper.LogApp($"{MethodBase.GetCurrentMethod().Name} - {_i}/{RelationsWithKeys.Count} - {_r} - Checking {_j} ({__r}) on {_v}({__a})");

                                if (DPAnalysis.AttributAnalyse_Results_Sort[__r][__a].Count_Attribute > 0)
                                {
                                    _Ret.FoundReferences.Add(DPRelationen_Helper.Test_Reference(RelationsWithKeys[_r], __r, __a));
                                }
                                _v++;
                            }
                            _j++;
                        }
                    }
                    _i++;
                }
                _Ret.FoundReferences.Sort((a, b) => a.GetEvaluation().CompareTo(b.GetEvaluation()));
            }

            return(_Ret);
        }