本文整理汇总了C#中SQL.AddTable方法的典型用法代码示例。如果您正苦于以下问题:C# SQL.AddTable方法的具体用法?C# SQL.AddTable怎么用?C# SQL.AddTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL.AddTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupTables
private void SetupTables(IDatabase Key, SQL.DataClasses.Database TempDatabase)
{
foreach (IMapping Mapping in Mappings[Key])
{
TempDatabase.AddTable(Mapping.TableName);
SetupProperties(TempDatabase[Mapping.TableName], Mapping);
}
}
示例2: SetupJoiningTablesEnumerable
private void SetupJoiningTablesEnumerable(IMapping Mapping, IProperty Property, IDatabase Key, SQL.DataClasses.Database TempDatabase)
{
if (TempDatabase.Tables.FirstOrDefault(x => x.Name == Property.TableName) != null)
return;
IMapping MapMapping = Mappings[Key].First(x => x.ObjectType == Property.Type);
if (MapMapping == Mapping)
{
TempDatabase.AddTable(Property.TableName);
TempDatabase[Property.TableName].AddColumn("ID_", DbType.Int32, 0, false, true, true, true, false, "", "", "");
TempDatabase[Property.TableName].AddColumn(Mapping.TableName + Mapping.IDProperty.FieldName,
Mapping.IDProperty.Type.ToDbType(),
Mapping.IDProperty.MaxLength,
false,
false,
false,
false,
false,
Mapping.TableName,
Mapping.IDProperty.FieldName,
"",
false,
false,
false);
TempDatabase[Property.TableName].AddColumn(MapMapping.TableName + MapMapping.IDProperty.FieldName + "2",
MapMapping.IDProperty.Type.ToDbType(),
MapMapping.IDProperty.MaxLength,
false,
false,
false,
false,
false,
MapMapping.TableName,
MapMapping.IDProperty.FieldName,
"",
false,
false,
false);
}
else
{
TempDatabase.AddTable(Property.TableName);
TempDatabase[Property.TableName].AddColumn("ID_", DbType.Int32, 0, false, true, true, true, false, "", "", "");
TempDatabase[Property.TableName].AddColumn(Mapping.TableName + Mapping.IDProperty.FieldName,
Mapping.IDProperty.Type.ToDbType(),
Mapping.IDProperty.MaxLength,
false,
false,
false,
false,
false,
Mapping.TableName,
Mapping.IDProperty.FieldName,
"",
true,
false,
false);
TempDatabase[Property.TableName].AddColumn(MapMapping.TableName + MapMapping.IDProperty.FieldName,
MapMapping.IDProperty.Type.ToDbType(),
MapMapping.IDProperty.MaxLength,
false,
false,
false,
false,
false,
MapMapping.TableName,
MapMapping.IDProperty.FieldName,
"",
true,
false,
false);
}
}