views:

819

answers:

7

I have been using Linq-to-SQL. What is a good option for working with mySQL? I have been looking at NHibernate, Entity Framework, etc. Some comparisons (pros, cons) would be helpful

+1  A: 

Try DbLinq.

It's not a full port of Linq to SQL, but it does the basics.

I haven't used it yet, but there also Linq support in nHibernate now (check the link).

Justin Niessner
Generating the object classes for DbLinq is a bit of a PITA in my experience.
Nathan Taylor
From my experience, DbMetal was a fairly painless experience. A bit of modification to the generated code and it worked just like Linq to SQL.
Justin Niessner
I agree; it's painless once you get it setup. I don't need to modify generated code, either.
sgwill
@Nathan - Agreed! A definate PITA!!!
Mark
+1  A: 

Entity Framework works for most things in MySQL. You will notice problems here and there, but chances are they'll all be manageable issues.

Nathan Taylor
+2  A: 

Nhibernate is quite mature and seams be to lighter compared to Entity framework.

Piotr Czapla
+1  A: 

The biggest downside to Entity Framework is the lack of native Lazy Loading. I've used NHibernate and Entity Framework - personally I prefer the richness of NHibernate but Entity Framework is fairly quick and easy to get going and isn't as bad as the rep it sometimes get.

Michael Gattuso
True, though check out the project *EFLazyLoading*, which enables lazy loading for entity framework.
Mark
I am aware of this project (hence use of the word native!) - in fact I am using it on a production system and it runs fine. There are a few quirks with it though.
Michael Gattuso
+1  A: 

Check out Telerik's OpenAccess ORM. It's free for any free or Open Source database platforms (in your case, MySQL), and provides a slick and easy-to-use GUI. Not to mention that Telerik has great support forums and a huge library of video training.

OpenAccess offers LINQ support, POCO, forward- and reverse-mapping, advanced caching, lazy- and aggressive-loading, no reflection, medium trust, and more. I use it daily (for MS Sql and Oracle data access) and have found it to be a great solution in enterprise scenarios and for my own personal projects.

Kevin Babcock
+4  A: 

LLBLGen. The current version 2.6 is awesome. The designer is really easy to use, supports entity inheritance, type converters (which also can be used to bridge the gap between different types across RDBMS), validation, auditing, authorization and a ton more. Most importantly though, their documentation is stellar and their support forum is very responsive. The lead developer (who is also on stackoverflow) also answers users questions. I can't say enough about this tool, try it. It is well worth the cost.

The next version is probably going to blow everything else out of the game. In addition to being able to generate their traditional data later, you will be able to gen nHibernate mapping files, entity framework and linq2sql.

Here is a discussion comparing LLBLGen to Entity Framework and to nHibernate (of course it might be biased since it is on their forum). http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=12811 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=14659

Bob
i found this useful so +1 cheers
Andi
+2  A: 

Have a look at Mindscape LightSpeed. It includes LINQ querying and a Visual Studio designer that works with MySQL natively. You can update your database or sync changes from your database directly from within the LightSpeed designer also.

Mindscape also publish an open source repository of helpers for asp.net MVC which includes things they have built up to make development with LightSpeed and MVC easier (for example, you'll likely end up wanting a custom ModelBinder for whatever underlying model objects you use - Mindscape provide one that is richer than the default model binder).

There is a free version available to play with:

Mindscape LightSpeed

One of the guys at Mindscape has also written a fairly deep set of blog posts about building up an ASP.NET MVC solution using LightSpeed (although it's probably helpful no matter what you're using :-)

ASP.NET MVC & LightSpeed Blogs Posts

traskjd