Exemple #1
0
        public void TestDeleteWhere()
        {
            var repository = new RepositoryMsSql <DictInfo>(Conn);
            var rst        = repository.Delete(x => x.DictID > 106093 && x.DictName == "哈哈哈");

            Assert.True(rst == 1 || rst == 0);
            Assert.Equal(0, repository.Count(x => x.DictID == 106094));
        }
Exemple #2
0
        public void TestDelete()
        {
            var repository = new RepositoryMsSql <DictInfo>(Conn);
            //这种方式需要类定义主键字段(Key特性)
            var rst = repository.Delete(100020);

            Assert.True(rst == 1 || rst == 0);
            Assert.Equal(0, repository.Count(x => x.DictID == 100020));
        }