Пример #1
0
        private void LoadTableRows()
        {
            ToTable.SetNumberOfRows((nint)_to.Count, "default");

            for (var i = 0; i < _to.Count; i++)
            {
                var elementRow = (ToRowController)ToTable.GetRowController(i);

                elementRow.ToLabel.SetText(_to[i].Name);
            }
        }
Пример #2
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }
            if (!base.Equals(o))
            {
                return(false);
            }

            var that = (MetaForeignKey)o;

            bool foundMatch = false;

            foreach (MetaForeignKeyColumnMapping thisMapping in ColumnMappings)
            {
                foreach (MetaForeignKeyColumnMapping thatMapping in that.ColumnMappings)
                {
                    if (thisMapping.Equals(thatMapping))
                    {
                        foundMatch = true;
                        break;
                    }
                }
                if (!foundMatch)
                {
                    return(false);
                }
            }

            if (DeleteRule != that.DeleteRule)
            {
                return(false);
            }
            if (!ToTable.Equals(that.ToTable, StringComparison.OrdinalIgnoreCase))
            {
                return(false);
            }
            if (UpdateRule != that.UpdateRule)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
            private string TrataCampo(string idName)
            {
                string id = $"[{idName}]";

                if (KeyConvention == "ClassId" && idName == "Id")
                {
                    if (ToTable.Contains("."))
                    {
                        id = $"[{ToTable.Split(".".ToArray())[1]}{idName}]";
                    }
                    else
                    {
                        id = $"[{ToTable}{idName}]";
                    }
                }
                ;
                return(id);
            }
Пример #4
0
 public override string ToString()
 {
     return(FromTable.ToString() + " -> " + ToTable.ToString());
 }