Linq 还是 ADO 或者?
使用数据库构建一个应用程序,该数据库能够变得很大,但可以定义具有一百万条以上记录的大表。我刚刚在某个地方看到 LINQ 不适合大型数据库。
前端将采用 Silverlight,我真的很期待使用其 Skip 和 Take 功能进行异步调用,以加快客户端首次访问我的 GUI 的速度。
您能告诉我这种情况会出现什么问题吗?
你会使用 LINQ 还是其他东西?
我的后端是 SQL Server 2005 或更高版本。
Building an application with a database that has the ability to get big not HUGE but definate big tables with a million records +. I just saw somewhere that LINQ isn't good for Big Datbases.
Front end will be in Silverlight and I was really looking forward to using its Skip and Take functionality for the Asynchronous calls to speed up the Clients first access to my GUI.
What can you tell me would be wrong with this scenario?
Woudl you use LINQ or something else?
MY BAck End is SQL Server 2005 or better.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我会使用 WCF 数据服务 (从服务器提供数据Silverlight 应用程序),实体框架 4 支持这些服务。
您可能还想查看 MSDN 杂志上的这篇文章,该文章将引导您创建一个简单的实体数据模型(从头开始)、模型之上的 WCF 数据服务,以及如何从 Silverlight 使用这些服务:
< a href="http://msdn.microsoft.com/en-us/magazine/ee336128.aspx" rel="nofollow noreferrer">Visual Studio - Visual Studio 2010 中的实体框架 4.0 和 WCF 数据服务 4.0
I would use WCF Data Services (to serve the data from the server to the Silverlight application) with Entity Framework 4 backing those services.
You might also want to check out this article from the MSDN magazine that walks you through creating a simple Entity Data Model (from the ground up), WCF Data Services on top of your model, and then how to consume those services from Silverlight:
Visual Studio - Entity Framework 4.0 and WCF Data Services 4.0 in Visual Studio 2010
我同意贾斯汀的回答,并且只提交我自己的答案,因为似乎没有人回答您在评论之一中提出的问题。
“实体有什么很棒,并且使它更快更容易?”
* 与实体框架结合使用的 LINQ 提供了非常干净的语法,经过一些学习曲线后更容易编写。
* IMO 从一开始就更容易阅读。
* 您获得智能感知。
* 您不会在 C# 或 VB 中嵌入混乱的 SQL。
* 你会得到一份不错的文档。
底线是您可以得到更好(更易于维护)的 C# 代码。
我还应该补充一点,使用 NHibernate 和其他 ORM 工具也可以获得这些相同的好处。实体框架不是您唯一的选择。
I agree with Justin's answer and am only submitting my own answer because no one appears to have answered the question you posed in one of your comments.
"Whats Entity have thats great and makes it faster and easier?"
* LINQ used in conjunction with Entity Framework provides a very clean syntax that after some learning curve is easier to write.
* IMO it is easier to read from nearly the beginning.
* You get Intellisense.
* You do not have the mess of SQL embedded in C# or VB.
* You get a nice document.
Bottom line is you more get better (easier to maintain) C# code.
I should also add that these same benefits can be gained from using NHibernate and other ORM tools. Entity Framework is not your only choice.
LINQ 实际上将 LINQ 代码语法转换为 SQL 命令(在幕后)。如果您对此有任何疑问,可以使用 SQL Profiler(也称为 SQL Trace)来查看 LINQ 在幕后生成的 SQL 命令。
在性能方面,它应该与 ADO.NET 类似。
LINQ actually converts your LINQ code syntax into SQL commands (under the hood). If you have any doubts about this, you can use the SQL Profiler (also known as SQL Trace) to see the SQL commands that are generated by LINQ behind the scenes.
Performance-wise, it should be similar to ADO.NET.
我同意 Justin 的观点,你绝对应该使用实体,但你应该以列表缓存查询的形式在实体上使用 LINQ。
IdeaBlade 的 DevForce 可能会提供更全面的解决方案。
I agree with Justin you should definitely use Entities, but you should be using LINQ on the entities in the form of cached queries to Lists.
IdeaBlade's DevForce may offer a more comprehensive solution.