NHibernate 的轻量级替代品 [英] Lightweight alternatives to NHibernate
问题描述
由于所有依赖关系,NHibernate 并不真正适合我们的环境.(城堡、log4net 等)
NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.)
有没有好的轻量级替代品?
Is there a good lightweight alternative?
必须支持简单的基于文件的数据库,例如 Access/SQLite/VistaDB.
Support for simple file based databases such as Access/SQLite/VistaDB is essential.
理想情况下,包含在仅引用 .NET 程序集的单个程序集中的内容.如果它只需要 .NET 框架 2.0 或 3.0,那就更好了.
Ideally, something contained in a single assembly that only references .NET assemblies. If it only requires .NET framework 2.0 or 3.0 that is a bonus.
推荐答案
一般来说,要使您的数据库后端与 .net 一起使用,您需要一个 ADO.Net 提供程序.
Generally speaking, for your database backend to work with .net you need an ADO.Net provider for it.
对于 MS Access (Jet),提供程序随 .net 一起提供.对于 SQLite,有一个独立的 ADO.Net Provider.
For MS Access (Jet), the Provider is shipped with .net. For SQLite, there is a selfcontained ADO.Net Provider.
至于数据访问层库,如果你想对 ADO.Net 进行一些抽象:
As for the data access layer lib, if you want some abstraction over ADO.Net:
- MS 数据访问应用程序块,ms 企业库.
iBatis.Net(是 2010 年由 Apache 基金会退休)MyBatis.net- ADOTemplate 来自 Spring 框架.net
- MS Data Access Application Block, a part of ms enterprise library.
iBatis.Net(Was retired by the Apache Foundation in 2010) MyBatis.net- ADOTemplate from the Spring Framework.net
从框架 2.0 及更高版本开始,所有这些都运行良好.
All those work well starting with framework 2.0 and up.
基本上,你选择(而且有很多选择)
Basically, you choose (and there is a lot of choices)
这篇关于NHibernate 的轻量级替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!