目前推荐用于 ASP.net 的哪个数据访问层?
我目前正在建立一个小型网站,在那里我写下出现的问题和答案以供其他人查看。 目前,我使用的 DAL 与此处描述的非常相似< /a>. 现在我一直在研究其他模型,特别是使用 Linq2SQL 和 ADO.net Entries 框架的基于 linq 的模型。 我意识到我正在以某种方式将数据访问移动到代码层,因为然后我会过滤掉例如带有 linq 查询的顶部列表。 我开始这样做的原因是因为 DAL 并未真正始终与数据库同步,并且当我更改数据库中的某些内容时,可空类型变得不可为空。 然后,如果我将表重新导入到数据表中,我的查询将会丢失。
我的简单问题是,如果您今天想要一个好的 ASP.net DAL,那会是什么? 非常欢迎建议、经验。
I'm currently building a small website where I write down problems that arise and answers to them for others to see. Currently I'm using a DAL much like the one described here. Now I have been looking at other models, and in particular linq based models using Linq2SQL and the ADO.net Entries framework. I realize I'm moving the data access to the code layer in a way since I'm then filtering out for example a toplist with linq queries. The reason I started doing this was because the DAL was not really syncing up with the DB at all times and nullable types became not nullable when I changed something in the DB. Then if I would reimport the tables into the data table my queries would be lost.
My simple question is really, if you want a good DAL for ASP.net today, what would that be? Suggestions, experiences are more than welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我个人更喜欢 LINQ to SQL 和 < strong>ADO.NET 实体框架。 微软人员也在他们的最新项目中使用了这些技术(看看 KOBE 项目为例)。 因此,微软也推荐这两个。
虽然..有时,当我需要最大限度地控制时,我会使用 企业库 中的数据访问应用程序块和手动 DAL 编码它的功能和实现。
其他替代方案是:NHibernate、SubSonic,不同的 ORM 解决方案,例如 LLBLGen Pro。
关于此主题的好书:
相关工具:
I personally preffer LINQ to SQL and ADO.NET Entity Framework. Microsoft guys also use those technologies in their latest projects (take a look at KOBE project for example). Thus, Microsoft recommends those two as well.
Though.. sometimes I use Data Access Application block from Enterprise Library and manual DAL coding when I need maximum control over it's functionality and implementation.
Other alternatives are: NHibernate, SubSonic, different ORM solutions like LLBLGen Pro.
Great books on this subject:
Related tools:
有很多选择,根据您的具体情况,每种选择都可能更好。 一些选项包括:
我的默认选择是 LINQ to SQL。 但这完全是个人喜好。 许多人都是 NHibernate 的拥护者。
There are many options and each of them might prove better depending on your specific circumstance. Some options include:
My default choice is LINQ to SQL. It's a completely personal preference though. Many guys are NHibernate advocates.
我在当前项目中使用 OPF3,主要是因为它对 Pervasive.SQL v9.5 具有出色的支持。 支持也很棒。
I'm using OPF3 for my current project, mostly because it has excellent support for Pervasive.SQL v9.5. The support is fantastic, as well.