//private static string GetModelFieldString(ColumnObjectModel column) //{ //} private static string GetModelPropertyString(ColumnObjectModel column) { string sqlDataType = EntityModelScript.IsNullable(column) ? $"{EntityModelScript.GetSqlDataMap(column.SqlDataType.Value)}{(column.InPrimaryKey ? string.Empty : "?")}" : EntityModelScript.GetSqlDataMap(column.SqlDataType.Value); string inPrimaryKey = column.InPrimaryKey ? "(Primary Key) " : string.Empty; string isForeignKey = column.IsForeignkey ? $"(Foreign Key from: {column.ForeignKeyTable}) " : string.Empty; string description = $"{inPrimaryKey}{isForeignKey}{column.Description}"; if (column.SqlDataType.Value == SqlDbType.Timestamp) { string resultSting = EntityModelScript.Setup.ModelPropertyString .Replace("{0}", description) .Replace("{1}", sqlDataType) .Replace("{2}", EntityModelScript.GetColumnName(column)); int insertIndex = resultSting.IndexOf("</summary>") + 10; resultSting = resultSting.Insert(insertIndex, $"{Environment.NewLine} [Timestamp]"); return(resultSting.ToString()); } // NOTE: We need to do a replace due to the brackets in the text here return(EntityModelScript.Setup.ModelPropertyString .Replace("{0}", description) .Replace("{1}", sqlDataType) .Replace("{2}", EntityModelScript.GetColumnName(column))); }
public static string[] GetColumnDotNetDescriptor(ColumnObjectModel column) { return(new string[] { EntityModelScript.GetSqlDataMap(column.SqlDataType.Value), EntityModelScript.GetColumnName(column) }); }