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)); }
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)); }
public void TestPageList() { var repository = new RepositoryMsSql <DictInfo>(Conn); var rst = repository.PageList(x => x.DictID > 5555, x => x.DictID, 1, 10, true); bool b = rst.Items.Count == 10; Assert.True(b); Assert.Equal(rst.Total, repository.Count(x => x.DictID > 5555)); }