public void QueryTest() { //条件查询 var ls = userManage.Get().Where(it => it.Id == 3).ToList(); ls.ForEach(item => { Console.Out.WriteLine(item.Name); }); Console.Out.WriteLine(); //所有查询 ls = userManage.Get().ToList(); ls.ForEach(item => { Console.Out.WriteLine(item.Name); }); Console.Out.WriteLine(); //模糊查询 ls = userManage.Get().Where(it => it.Name.Contains("小")).ToList(); ls.ForEach(item => { Console.Out.WriteLine(item.Name); }); Console.Out.WriteLine(); //分页 ls = userManage.Get().Skip(2).Take(3).ToList(); ls.ForEach(item => { Console.Out.WriteLine(item.Name); }); Console.Out.WriteLine(); }
public void QueryTest() { var ls = commentManage.Get().Where(it => it.ArticleId == 2).ToList(); ls.ForEach(item => { Console.Out.WriteLine(item.CommentatorId); Console.Out.WriteLine(item.Content); Console.Out.WriteLine(); }); }
public void QueryTest() { var ls = articleManage.Get().ToList(); ls.ForEach(item => { Console.Out.WriteLine(item.Name); Console.Out.WriteLine(); }); }