Question

Just wondering what everyones thoughts on what ORM to use for SQL Azure?

I'm fairly comfortable using LINQ-to-SQL and I believe it is possible to get it working with SQL Azure. However, from my understanding (correct me if I'm wrong), no further improvements will be made to Linq-to-SQL in future releases of the .NET framework?

Alternatively, there is the entity framework... and further afield from the Microsoft Camp is NHibernate.

Ideally, any additional suggestions made should be free or open source. I have seen Telerik's ORM but this of course, is a commercial product.

I can get the definitions/benefits of each ORM myself by doing a Google search, but I was just interested in peoples opinions as to which ORM seems to work best for them (even if it is none of the above)

Was it helpful?

Solution

We're using NHibernate on Azure at the moment and are finding it pretty good.

Because we're using s#arp architecture to provide the majority of the plumbing code for NHibernate and Dependency Injection we've managing to get projects fired up pretty quickly with a good solid foundation. All told it's been pretty painless but there can be a bit of a steep learning curve with NHibernate when you first start.

I'm not sure if you're aware of Fluent NHibnerate - http://fluentnhibernate.org - but it's a great tool and will automatically map your business objects onto your database. It can of course be customised to whatever behaviour you need.

OTHER TIPS

DataObjects.Net supports SQL Azure. It's available under GPL (but not LGPL - i.e. if GPL is too strict for you, you must acquire a commercial license).

I have recently fallen in love with Entity Framework 4.0's "Code First" approach to ORM/data-persistence.

Make no mistake - EF4.0 is lightyears ahead of previous versions of EF and propels EF to being a true competitor in the ORM market.

Read through Hanselman's EF code first demo script from PDC 2010 or Scott Guthrie's walk-through of Code First :)

Check out NHibernate. Probably top of the line right now.

Otherwise a good resource is always http://www.ormbattle.net/

I use Linq-to-SQL with my SQL Azure database. I have a simple one-to-one model between my classes and database tables so it's the simplest solution and works prefectly (a few SQL Azure glitches aside).

The Entity Framework vs LINQ to SQL question will answer that one for you.

I've been using Entity Framework 1.0 fairly successfully, and I'm pretty sure 4.0 will be even better, particularly with it's support for POCOs (so you're free from context related objects from the beginning). Either version, the LINQ support does make a huge difference once you get the hang of it.

But I would say that you should regard any ORM as just an option - if you set up your data access layer to use the Unit of Work and Repository patterns, then use your favourite Inversion of Control container to inject the particular implentation, then you gain yourself a bit more work setting up, but a lot more long term freedom. Who really cares where the data is or how you're getting it past a certain level, it's what you do with it that counts

that's what I reckon ...

Toby

Jamie,

Like Toby I have been using the EF with success. I highly recommend it. Note that as I post this I had to generate the Model from a local version of our schema. This is not a bid deal, but is worth mentioning. Expect this to change in the future.

Ian

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top