1 /// <summary> 2 /// 数据库 3 /// </summary> 4 public class Database 5 { 6 public string Name { get; set; } 7 }
1 /// 表 2 /// </summary> 3 public class Table 4 { 5 /// <summary> 6 /// 所属数据库 7 /// </summary> 8 public string DatabaseName { get; set; } 9 10 /// <summary> 11 /// 数据库 12 /// </summary> 13 public Database Database { get; set; } 14 15 /// <summary> 16 /// 表名称 17 /// </summary> 18 public string Name { get; set; } 19 20 /// <summary> 21 /// 说明 22 /// </summary> 23 public string Explain { get; set; } 24 25 }
1 /// <summary> 2 /// 字段 3 /// </summary> 4 public class Column 5 { 6 /// <summary> 7 /// 所属表 8 /// </summary> 9 public string TableName { get; set; } 10 11 /// <summary> 12 /// 表 13 /// </summary> 14 public Table Table { get; set; } 15 16 /// <summary> 17 /// 名称 18 /// </summary> 19 public string Name { get; set; } 20 21 /// <summary> 22 /// 是否是标知 23 /// </summary> 24 public bool IsMarke { get; set; } 25 26 /// <summary> 27 /// 是否主键 28 /// </summary> 29 public bool IsPrimarykey { get; set; } 30 31 /// <summary> 32 /// 类型 33 /// </summary> 34 public string Type { get; set; } 35 36 /// <summary> 37 /// 字节数 38 /// </summary> 39 public int Bytes { get; set; } 40 41 /// <summary> 42 /// 长度 43 /// </summary> 44 public int Length { get; set; } 45 46 /// <summary> 47 /// 小数位数 48 /// </summary> 49 public int DecimalPlaces { get; set; } 50 51 /// <summary> 52 /// 是否允许空 53 /// </summary> 54 public bool IsNull { get; set; } 55 56 /// <summary> 57 /// 默认值 58 /// </summary> 59 public string DefaultValue { get; set; } 60 61 /// <summary> 62 /// 说明 63 /// </summary> 64 public string Explain { get; set; } 65 }
1 /// <summary> 2 /// 表关系 3 /// </summary> 4 public class Relation 5 { 6 /// <summary> 7 /// 主键表 8 /// </summary> 9 public Table PrimaryTable { get; set; } 10 11 public string PrimaryTableName { get; set; } 12 13 /// <summary> 14 /// 外键表 15 /// </summary> 16 public Table ForeignTable { get; set; } 17 18 public string ForeignTableName { get; set; } 19 20 /// <summary> 21 /// 外键字段 22 /// </summary> 23 public Column ForeignKey { get; set; } 24 25 public string ForeignKeyName { get; set; } 26 27 /// <summary> 28 /// 主键字段 29 /// </summary> 30 public Column PrimaryKey { get; set; } 31 32 public string PrimaryKeyName { get; set; } 33 }