本文整理汇总了C#中IDbConnection.GetLastSql方法的典型用法代码示例。如果您正苦于以下问题:C# IDbConnection.GetLastSql方法的具体用法?C# IDbConnection.GetLastSql怎么用?C# IDbConnection.GetLastSql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDbConnection
的用法示例。
在下文中一共展示了IDbConnection.GetLastSql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAndInitialize
private DefaultValues CreateAndInitialize(IDbConnection db, int count = 1)
{
db.DropAndCreateTable<DefaultValues>();
db.GetLastSql().Print();
DefaultValues firstRow = null;
for (var i = 1; i <= count; i++)
{
var defaultValues = new DefaultValues { Id = i };
db.Insert(defaultValues);
var row = db.SingleById<DefaultValues>(1);
row.PrintDump();
Assert.That(row.DefaultInt, Is.EqualTo(1));
Assert.That(row.DefaultIntNoDefault, Is.EqualTo(0));
Assert.That(row.NDefaultInt, Is.EqualTo(1));
Assert.That(row.DefaultDouble, Is.EqualTo(1.1).Within(.1d));
Assert.That(row.NDefaultDouble, Is.EqualTo(1.1).Within(.1d));
Assert.That(row.DefaultString, Is.EqualTo("String"));
if (firstRow == null)
firstRow = row;
}
return firstRow;
}
示例2: CreateAndInitialize
private DefaultValues CreateAndInitialize(IDbConnection db)
{
db.DropAndCreateTable<DefaultValues>();
db.GetLastSql().Print();
db.Insert(new DefaultValues { Id = 1 });
var row = db.SingleById<DefaultValues>(1);
row.PrintDump();
Assert.That(row.DefaultInt, Is.EqualTo(1));
Assert.That(row.DefaultIntNoDefault, Is.EqualTo(0));
Assert.That(row.NDefaultInt, Is.EqualTo(1));
Assert.That(row.DefaultDouble, Is.EqualTo(1.1).Within(.1d));
Assert.That(row.NDefaultDouble, Is.EqualTo(1.1).Within(.1d));
Assert.That(row.DefaultString, Is.EqualTo("String"));
return row;
}