3

I'm pretty new to Code First EF 4.1 and NHibernate. I need to develop a ORM that must have following features.

  1. Perform CRUD with composite key
  2. Use Custom SQL Statement for some case.
  3. Can change connection at run time.
  4. Can Log SQL Statement before or after execution.
  5. Need to support Both MS SQL and Oracle.

I'm a bit confuse which one to choose. Please kindly advice.

0

4 Answers 4

4

Well, here's a general comparison of features:

.net ORM Comparison

Regarding your needs, both EF and NH support 1, 2, 3 and 5.

Logging is a different story. EF has absolutely nothing out of the box. NH logs everything, and you can choose diffent levels, loggers, etc.

Sign up to request clarification or add additional context in comments.

1 Comment

Just a NOTE, that both are ... the same (It could be read this way, while you did NOT stated it explicitly;). What makes me crazy in EF is, that I cannot map smallint (DB) into int (C#). Let's say, that DB admins have optimized some primary keys (referenced in a fact table with millions of records - reasonable)... and I have to change App tier implementation. Where is Separation of Concern? That is not an issue with NHibernate. But these small differencies I am finding everywhere...
3

I use NHibernate and I think you can achieve all of your request with it.

Try look here for more info:

Deciding between NHibernate vs Entity Framework?

Comments

3

I would go for Nhibernate. It supports all these features and is more battle-tested than EF at this point in time.

Comments

2

It might be a bit late, but I've just published a more recent comparison of NHibernate 3.x and Entity Framework 5 and 6. http://www.dennisdoomen.net/2013/03/entity-framework-56-vs-nhibernate-3.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.