private string GetFkName(ForeignKey key)
        {
            var isBackReference = key.KeyName.Contains("BackReference");
            var keyName         = key.KeyName.Replace("FK_", "").Replace("_T", "").Replace("_BackReference", "");

            var parts = keyName.Split('_');

            if (parts.Length == 1)
            {
                return(key.KeyName);
            }

            if (isBackReference)
            {
                return(parts[0]);
            }

            return(parts[1]);
        }
        private void RenderForeignKey(ForeignKey key, CodeType codeType)
        {
            //if (!RenderForeignKeys)
            //{
            //	return;
            //}

            //if (codeType == CodeType.DataObject)
            //{
            //	WriteComment(" " + key.KeyName);
            //	WriteLine("[Association(ThisKey=\"{0}\", OtherKey=\"{1}\", CanBeNull={2})]",
            //		string.Join(", ", (from c in key.ThisColumns select c.ColumnName).ToArray()),
            //		string.Join(", ", (from c in key.OtherColumns select c.MemberName).ToArray()),
            //		key.CanBeNull ? "true" : "false");

            //	if (key.Attributes.Count > 0)
            //	{
            //		WriteAttribute(string.Join(", ", key.Attributes.DistinctBy(a => a.Name).ToArray()));
            //		WriteAttributeLine();
            //	}
            //}

            //Write("public ");

            //var otherTableName = RemoveSuffix(key.OtherTable.DataObjectClassName, "_t");

            //if (key.AssociationType == AssociationType.OneToMany)
            //{
            //	Write(codeType == CodeType.DataObject
            //		? OneToManyDataObjectAssociationType
            //		: OneToManyPocoAssociationType, otherTableName);
            //}
            //else
            //{
            //	Write(otherTableName);
            //}

            //Write(" ");
            //Write(otherTableName);
            //if (key.AssociationType == AssociationType.OneToMany)
            //{
            //	if (otherTableName.EndsWith("s"))
            //	{
            //		Write("es");
            //	}
            //	else
            //	{
            //		Write("s");
            //	}
            //}
            //else if (key.OtherTable.DataObjectClassName == otherTableName)
            //{
            //	Write("Other");
            //}

            //if (RenderField)
            //{
            //	WriteLine(";");
            //}
            //else
            //{
            //	WriteLine(" { get; set; }");
            //}
        }