c# - Fetch 和 Query 有什么区别?

标签 c# petapoco

对我来说,PetaPoco 的 Database.FetchDatabase.Query 似乎在做同样的事情。

例如,

var db = new PetaPoco.Database("myDB");
ProductList products = db.Fetch<ProductList>("SELECT * FROM ProductList");
ProductList products = db.Query<ProductList>("SELECT * FROM ProductList");

它们之间有什么显着的区别吗?

最佳答案

根据PetaPoco documentation ,这是答案:

Query vs Fetch

The Database class has two methods for retrieving records Query and Fetch. These are pretty much identical except Fetch returns a List<> of POCO's whereas Query uses yield return to iterate over the results without loading the whole set into memory.

关于c# - Fetch 和 Query 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24059871/

相关文章:

c# - PetaPoco 未返回预期数据

.net - 如何对使用 PetaPoco.Database 的服务进行单元测试

petapoco - 如何使用 petapoco 创建 DAL

c# - 绑定(bind)运行次数可变的 RichTextBox

c# - 如何使用c#从输入的域名中去除http ://and www.

c# - 搜索字符串列表以查找文件名匹配并替换为新文件路径

c# - 什么是 Microsoft.Web.Services2.dll

c# - 在命令文本中设置 ANSI_NULLS 会出现错误

architecture - 如何在 3 层应用程序中构造 PetaPOCO 生成的代码?

c# - 使用微型 ORM 时的最佳策略?