当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteAsyncConnection.GetAsync方法代码示例

本文整理汇总了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);
        }
开发者ID:NateRickard,项目名称:SQLite.Net-PCL,代码行数:12,代码来源:TimeSpanTest.cs

示例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);
        }
开发者ID:FatJohn,项目名称:sqlite-net,代码行数:16,代码来源:DateTimeTest.cs

示例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);
        }
开发者ID:happynik,项目名称:SQLite.Net-PCL,代码行数:17,代码来源:DateTimeTest.cs

示例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());
        }
开发者ID:Reza1024,项目名称:SQLite.Net-PCL,代码行数:17,代码来源:DateTimeTest.cs

示例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);
        }
开发者ID:jamesottaway,项目名称:SQLite.Net-PCL,代码行数:20,代码来源:DateTimeTest.cs


注:本文中的SQLiteAsyncConnection.GetAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。