本文整理汇总了C#中IQuery.GetMutableTable方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.GetMutableTable方法的具体用法?C# IQuery.GetMutableTable怎么用?C# IQuery.GetMutableTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuery
的用法示例。
在下文中一共展示了IQuery.GetMutableTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTestData
private void AddTestData(IQuery context)
{
var table = context.GetMutableTable(ObjectName.Parse("APP.people"));
var row = table.NewRow();
// row.SetValue("id", DataObject.Integer(0));
row.SetDefault(0, context);
row.SetValue("first_name", DataObject.String("John"));
row.SetValue("last_name", DataObject.String("Doe"));
row.SetValue("birth_date", DataObject.Date(new SqlDateTime(1977, 01, 01)));
row.SetValue("active", DataObject.Boolean(false));
table.AddRow(row);
row = table.NewRow();
// row.SetValue("id", DataObject.Integer(1));
row.SetDefault(0, context);
row.SetValue("first_name", DataObject.String("Jane"));
row.SetValue("last_name", DataObject.String("Doe"));
row.SetValue("birth_date", DataObject.Date(new SqlDateTime(1978, 11, 01)));
row.SetValue("active", DataObject.Boolean(true));
table.AddRow(row);
row = table.NewRow();
// row.SetValue("id", DataObject.Integer(2));
row.SetDefault(0, context);
row.SetValue("first_name", DataObject.String("Roger"));
row.SetValue("last_name", DataObject.String("Rabbit"));
row.SetValue("birth_date", DataObject.Date(new SqlDateTime(1985, 05, 05)));
row.SetValue("active", DataObject.Boolean(true));
table.AddRow(row);
context.Commit();
}
示例2: InsertTestData
private void InsertTestData(IQuery query)
{
var tableName = ObjectName.Parse("APP.test_table");
var table = query.GetMutableTable(tableName);
var row = table.NewRow();
row.SetValue("first_name", DataObject.String("Antonello"));
row.SetValue("last_name", DataObject.String("Provenzano"));
row.SetValue("birth_date", DataObject.Date(new SqlDateTime(1980, 06, 04)));
row.SetValue("active", DataObject.BooleanTrue);
row.SetDefault(query);
table.AddRow(row);
row = table.NewRow();
row.SetValue("first_name", DataObject.String("Sebastiano"));
row.SetValue("last_name", DataObject.String("Provenzano"));
row.SetValue("birth_date", DataObject.Date(new SqlDateTime(1981, 08, 26)));
row.SetValue("active", DataObject.BooleanFalse);
row.SetDefault(query);
table.AddRow(row);
}