Beispiel #1
0
        public static CSharpType ToCSharpType(this Column column)
        {
            var csType = new CSharpType(column.ToStringType());

            csType.Nullable = column.IsNullable.Equals("yes", StringComparison.OrdinalIgnoreCase);
            csType.Unsigned = column.ColumnType.IndexOf("unsigned", StringComparison.OrdinalIgnoreCase) >= 0;
            csType.Type     = column.ToType();
            return(csType);
        }
Beispiel #2
0
 public CSharpProperty(Column column, CSharpType csType)
 {
     Column       = column;
     CSharpType   = csType;
     PropertyName = column.ColumnName.ToPropertyName();
     if (Column.ColumnKey == "PRI" && Column.Extra == "auto_increment")
     {
         AttributeText = $"[Key(__{PropertyName})]";
     }
     else
     {
         AttributeText = $"[Column(__{PropertyName})]";
     }
     PropertyText   = $"public {CSharpType.FullStringType} {PropertyName} {{ get; set; }}";
     ColumnConstant = $"public const string __{PropertyName} = \"{column.ColumnName}\";";
 }