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