C# 什么是一些好的实体框架替代品
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1841555/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are some good Entity Framework Alternatives
提问by Luke101
I am using the Entity Framework now and constantly having to write inline sql because Entity framework does not support full text search and other features. Is there a ORM out there that has many features that supports advanced queries? I feel if I am going to sometimes write inline sql I might as well do all of it in inline sql. Any help here
我现在正在使用实体框架,并且经常不得不编写内联 sql,因为实体框架不支持全文搜索和其他功能。是否有一个 ORM 具有许多支持高级查询的功能?我觉得如果我有时要编写内联 sql,我不妨在内联 sql 中完成所有这些。任何帮助在这里
采纳答案by Alex Yakunin
Take a look at:
看一眼:
- LINQ queries in DataObjects.Net. If you're interesting in most complex parts, start from the tail.
- Advanced LINQ in DataObjects.Net. Some underlying SQL queries are shown there.
- DataObjects.Net 中的 LINQ 查询。如果您对最复杂的部分感兴趣,请从尾部开始。
- DataObjects.Net 中的高级 LINQ。那里显示了一些底层 SQL 查询。
回答by Paul Sasik
Have you looked at nHibernate?
你看过nHibernate吗?
If you search for nHibernate and full text searchyou'll come up with a variety of links that talk about that particular type of search implementation.
如果您搜索nHibernate 和全文搜索,您将找到各种讨论特定类型搜索实现的链接。
回答by Michael Gattuso
NHibernateis one of the bigger OR/M alternatives and Open Source that I like. It is can do some pretty "advanced" things but has a steep learning curve.
NHibernate是我喜欢的更大的 OR/M 替代品和开源之一。它可以做一些非常“高级”的事情,但学习曲线陡峭。
回答by anishMarokey
Try with nHibernate
尝试使用nHibernate
回答by μBio
回答by Brian Sullivan
You might look at LLBLGen Proor Telerik's OpenAccess, but NHibernate is going to be the solution with the largest community around it.
您可能会查看LLBLGen Pro或 Telerik 的OpenAccess,但 NHibernate 将成为拥有最大社区的解决方案。
回答by LJW
I feel if I am going to sometimes write inline sql I might as well do all of it in inline sql
我觉得如果我有时要编写内联 sql,我也可以在内联 sql 中完成所有这些工作
Seriously? When using any ORM, you're always going to hit situations where it is better, cleaner, or more performant, to use SQL or call a stored proc. You shouldn't just blindly trust it do absolutely everything for you in all situations.
严重地?使用任何 ORM 时,您总是会遇到使用 SQL 或调用存储过程更好、更干净或性能更高的情况。你不应该只是盲目地相信它在所有情况下都能为你做任何事情。
回答by Kevin Pang
Most ORMs will still require some inline SQL every now and then. NHibernate, Linq 2 Sql, etc. don't support full text search out of the box (NHibernate has NHibernate.Search which uses Lucene.NET to perform full text search, Linq 2 Sql has access to stored procedures that you can create that use full text search).
大多数 ORM 仍然会时不时地需要一些内联 SQL。NHibernate、Linq 2 Sql 等不支持开箱即用的全文搜索(NHibernate 有使用 Lucene.NET 执行全文搜索的 NHibernate.Search,Linq 2 Sql 可以访问您可以创建的存储过程,使用全文检索)。
This doesn't mean you should scrap using an ORM altogether though. There's a tonof repetitive plumbing code that ORMs can save you from writing and the general use cases are all relatively easy to execute (e.g. CRUD operations) with any ORM.
不过,这并不意味着您应该完全放弃使用 ORM。有一吨的重复管道代码的ORM可以从写作拯救你们,一般使用情况下都比较容易执行(如CRUD操作)与任何ORM。
回答by Arthur C
Like most people here I'd recommend NHibernate, but you may want to look into using it in conjunction with CastleProject's ActiveRecordimplementation. NHibernate by itself can take a bit of getting used to, but when you throw ActiveRecord on top of it things get a lot easier. I was able to do an EntityFramework->NHibernate/ActiveRecord conversion really quickly.
像这里的大多数人一样,我建议使用 NHibernate,但您可能想考虑将它与CastleProject 的 ActiveRecord实现结合使用。NHibernate 本身可能需要一点时间来适应,但是当您将 ActiveRecord 放在它上面时,事情会变得容易得多。我能够非常快速地进行 EntityFramework->NHibernate/ActiveRecord 转换。