コード例 #1
0
        public void TreeMonDbContext_Context_Delete_Async()
        {
            Task.Run(async() =>
            {
                TreeMonDbContext context = new TreeMonDbContext("MSSQL_TEST");
                User u = TestHelper.GenerateTestUser("DELETE_ME");
                context.Insert <User>(u);
                Assert.AreEqual(context.Get <User>(u.Id).Name, "DELETE_ME");

                int res = await context.DeleteAsync <User>(u);
                Assert.AreEqual(res, 1);
                Assert.IsNull(context.Get <User>(u.Id));
            }).GetAwaiter().GetResult();
        }