public void TestRole() { RoleDal role = new RoleDal(); //role.Insert(new Role {Rid = 1,Rname = "hahaha", Rscore = 3.3 }); //role.Delete(new Role {Rname = "hahaha"}); var result = role.GetEntities(p => p.Rscore <= 8); using (StreamWriter writer = new StreamWriter(@"C:\Users\lenovo\Desktop\t.txt", true)) { foreach (var q in result) { writer.WriteLine(q.Rname); } } }