N2cms with entity framework

Topics: Developer Forum, Project Management Forum, User Forum
Jul 18, 2012 at 2:26 PM

Hi!

Im new at N2, so I downloaded N2.Templates.MVC and started to play around.

But now I whant to take it one step further and implement a ORM, the only one I've worked with is EF so is there any guide how I should do implement it to my template?

Or is this the wrong way to go? Perhaps it's pointless to use a ORM to the template?

Jul 18, 2012 at 7:15 PM

It's not clear what you're asking but you should dig deeper into N2.  Look through the source code. N2 uses NHibernate as an ORM.

Jul 18, 2012 at 9:19 PM

Ok i see. Is N2 uses NHibernate in the templates only or is it a choice to choose witch ORM I want to have in "N2, MVC Example" that is more minimum code?

Never worked with NHibernate before, that's why im asking.

Otherwise I'll need to start learning NHibernate as well.

Coordinator
Jul 18, 2012 at 10:44 PM

You can use entity framework in your app but N2 uses nhibernate to store content.

Jul 19, 2012 at 9:31 AM

Ok. Is there any big advantage to use nhibernate because N2 uses it?

Do I need to use two databases for my app? One for N2 and nhibernate that comes along the template, and one to entity framework that I create by my self?

Jul 19, 2012 at 3:21 PM

We have two databases. The N2 database with Hibernate and a second databse with Entity Framework an our custom Entities. We have no problems with this solution.

Coordinator
Jul 19, 2012 at 11:02 PM

You might be able to find some benefits if you want to integrate deeply, but beeing new to nhibernate you should wait a bit with that anyway.

Other than that NH is stronger compared to EF in some areas (and weaker in others). No need to base that decision on N2.

Jul 23, 2012 at 9:00 AM

Ok thank you for some good answears. Is there any good tutorials to begin with? Found the N2 CMS Developer Documentation.