本文整理汇总了C#中SQLiteAsyncConnection.GetAsync方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteAsyncConnection.GetAsync方法的具体用法?C# SQLiteAsyncConnection.GetAsync怎么用?C# SQLiteAsyncConnection.GetAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLiteAsyncConnection
的用法示例。
在下文中一共展示了SQLiteAsyncConnection.GetAsync方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAsyncDateTime
private async Task TestAsyncDateTime(SQLiteAsyncConnection db)
{
await db.CreateTableAsync<TestDb>();
var val1 = new TestDb
{
Time = new TimeSpan(1000),
};
await db.InsertAsync(val1);
TestDb val2 = await db.GetAsync<TestDb>(val1.Id);
Assert.AreEqual(val1.Time, val2.Time);
}
示例2: TestAsyncDateTime
void TestAsyncDateTime(SQLiteAsyncConnection db)
{
db.CreateTableAsync<TestObj> ().Wait ();
TestObj o, o2;
//
// Ticks
//
o = new TestObj {
ModifiedTime = new DateTime (2012, 1, 14, 3, 2, 1, 234),
};
db.InsertAsync (o).Wait ();
o2 = db.GetAsync<TestObj> (o.Id).Result;
Assert.AreEqual (o.ModifiedTime, o2.ModifiedTime);
}
示例3: TestAsyncDateTime
private async Task TestAsyncDateTime(SQLiteAsyncConnection db)
{
await db.CreateTableAsync<TestObj>();
TestObj o, o2;
//
// Ticks
//
o = new TestObj
{
ModifiedTime = new DateTime(2012, 1, 14, 3, 2, 1),
};
await db.InsertAsync(o);
o2 = await db.GetAsync<TestObj>(o.Id);
Assert.AreEqual(o.ModifiedTime, o2.ModifiedTime);
}
示例4: TestAsyncDateTime
private async Task TestAsyncDateTime(SQLiteAsyncConnection db, bool storeDateTimeAsTicks)
{
await db.CreateTableAsync<TestObj>();
var org = new TestObj
{
Time1 = DateTime.UtcNow,
Time2 = DateTime.Now,
};
await db.InsertAsync(org);
var fromDb = await db.GetAsync<TestObj>(org.Id);
Assert.AreEqual(fromDb.Time1.ToUniversalTime(), org.Time1.ToUniversalTime());
Assert.AreEqual(fromDb.Time2.ToUniversalTime(), org.Time2.ToUniversalTime());
Assert.AreEqual(fromDb.Time1.ToLocalTime(), org.Time1.ToLocalTime());
Assert.AreEqual(fromDb.Time2.ToLocalTime(), org.Time2.ToLocalTime());
}
示例5: TestAsyncDateTime
private async Task TestAsyncDateTime(SQLiteAsyncConnection db, bool storeDateTimeAsTicks)
{
await db.CreateTableAsync<TestObj>();
TestObj o, o2;
//
// Ticks
//
o = new TestObj
{
ModifiedTime = DateTime.UtcNow,
};
await db.InsertAsync(o);
o2 = await db.GetAsync<TestObj>(o.Id);
Assert.AreEqual(o.ModifiedTime, o2.ModifiedTime.ToUniversalTime());
var expectedTimeZone = storeDateTimeAsTicks ? DateTimeKind.Utc : DateTimeKind.Local;
Assert.AreEqual(o2.ModifiedTime.Kind, expectedTimeZone);
}