Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code First Entity Framework Or NHibernate

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.

like image 916
Soe Lwin Htoo Avatar asked Feb 04 '26 06:02

Soe Lwin Htoo


2 Answers

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.

like image 123
Diego Mijelshon Avatar answered Feb 07 '26 17:02

Diego Mijelshon


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?

like image 21
danyolgiax Avatar answered Feb 07 '26 17:02

danyolgiax