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.

Daniel P
  • 3,314
  • 1
  • 36
  • 38
Soe Lwin Htoo
  • 51
  • 1
  • 3

4 Answers4

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.

Community
  • 1
  • 1
Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154
  • 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... – Radim Köhler Jun 12 '13 at 02:53
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?

Community
  • 1
  • 1
danyolgiax
  • 12,798
  • 10
  • 65
  • 116
3

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

Sriram
  • 838
  • 7
  • 15
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

Dennis Doomen
  • 8,368
  • 1
  • 32
  • 44