views:

115

answers:

6

I have a new project where I want to use MVC (I will be learning as I code), and I have never used linq or entity (or mvc). Which should I use? Does it matter?

edit: I will be having a lot of different databases, from Oracle to FoxPro.

A: 

Depends what your requirements, but just a point that Linq2SQL team nolonger exists, the developers moved the EF team.

Cheers

Iain

Iain
Microsoft has said that they will continue to support L2SQL, though.
XSaint32
+1  A: 

Linq2Sql and EF are ORMs, whereas MVC is a web framework. In other words, you can use MVC with either L2S or EF.

As far as which ORM to use, that depends mostly on whether or not you plan on switching from SQL Server to some other database software. Linq2SQL is, well, SQL-specific and is more tightly coupled to the datastore. EF allows you to de-couple your domain layer from your data access layer, and, thus, allows you to switch the underlying database at some point in the future without having to refactor up your application stack.

Just my 2 cents.

XSaint32
so I can use the ORM with any database if I use EF?
johnny
@johnny - Yes. You could also use NHibernate with any database.
XSaint32
A: 

lot of different databases

Entity framework because linq to sql supports only ms sql server

eglasius
A: 

Doesn't matter one bit. Up to you.

Jack Marchetti
A: 

I would honestly use a tool called EntitySpaces. It is similar to EntityFramework, but much much better. It allows for very natural sql like syntax while abstracting away all the DB stuff. You can use it on virtually all DB types and it also supports data access using sql commands or through stored procedures.

It is by far better than entity framework.

Patrick
+1  A: 

I was in the same position as you a few months back. I took on a project to be done in MVC after spending a lot of time in ASP.NET web forms and using (very happily and successfully) subsonic as the ORM.

I opted to use the Entity Framework and although MVC and the EF were completely new to me, I have not lived to regret it. I like the structure and separation it brings. It produces much cleaner code which in turn makes it easier to maintain too. In fact, when I have to go back to maintain older projects we have done in web forms, the benefits of MVC and the EF become even clearer. Linq to Entities is very quick to pick up too and becomes second natuire to you very quickly as well.

So in my opinion, use MVC and the Entity Framework, you'll thank yourself in the long run.

macou