tags:

views:

3909

answers:

14

I'm interested in using an Object-Relational Mapping package for an upcoming project. This project will begin as an ASP.NET application but will have lots of functionality that will eventually be shared with WinForms applications. Can anyone suggest some good, free ORM packages that work well in both ASP.NET and WinForms situations?

+3  A: 

NHibernate

Manu
+4  A: 

Try , Subsonic

and you can use Linq2Sql ORM as well.

Moran
+5  A: 

I always recommend Castle ActiveRecord. It's a layer on top of NHibernate. It works great in both environments you've mentioned.

Ryan Duffield
+4  A: 

nHibernate works for me, but it all depends on what you are after. A lot of people don't want to go down the full DDD and unit testing route. They just want something simple to map their database to objects to make the code a bit nicer. If thats the case then look at Subsonic as well as it is possibly easier to get started.

Craig
+8  A: 

SubSonic is not as extensive as nHibernate; rather, it is a straight forward Active Record 1 class per table Data Access Layer.

Some of the features are a query tool, ability to execute stored procedures and a scaffolding app in ASP.net. You can be up and running within 30 minutes or less, with a tiny learning curve and minimal configuration in the Config.app file.

David Robbins
Omu
@OOmu - I was looking at valueinjecter a few weeks ago. It looks very promising. Do you have direct experience with it?
David Robbins
A: 

I've been using SubSonic for about a year now for a handful of ASP.NET apps as well as a WinForms app. It is extremely easy to get started with and I have not yet been "painted into a corner" by choosing it -- there is almost always some way to do what you need, usually easily. I estimate it has shaved 30% off of our development time. Not a true ORM tool but provides a great productivity boost.

djuth
A: 

I agree with Ryan, don't bother with NHibernate use Active Record instead, it will make your life much more enjoyable.

Jacksonh
+1  A: 

See this List of ORM tools ".Net"

It contains all the famous .Net ORM tools

Amr ElGarhy
+1  A: 

I didn't investigate ActiveRecord simply by the fact that according to independant serveys it does not perform as fast as many other ORMs and it does not have a full Linq implementation.

DataObjects.NET requires that all your entities be derived from special classes, but in exchange for this you respectable performance and goodies like in-memory storage providers and the most complete Linq implementation going.

I spend the afternoon sifting through the source code of DBLinq. My opinion is that it is immature (many of Linq-To-SQL's features are simply not implemented), and I wouldn't recommend it for production systems.

So then... if you're looking for a free, fast, open source, LINQ compliant ORM then DataObjects.NET is a pretty safe bet.

Mark
+3  A: 

I favour Fluent NHibernate, which lets you create mappings in strongly-types C#, rather than using the normal NHibernate XML files. It lets you mix and match too (you can have mappings in code and in XML).

There's a nice getting started article here.

Cocowalla
A: 

I use NHibernate and NHibernate Annotations. It is working well - without mapping files (entity.xml). Unfortunately you have to at Log4net which requires a tiny xml file.

mmic
A: 

Habanero, great and powerful ORM. It's free (LGPL license), work with .net 2.0 (it's very important for me) and have a powerful tools for generating model from database (with custom class and properties names, custom validation etc.)

Drucik
+1  A: 

Checkout XmlDataMapper a simple free ORM (LGPL Licence) which leaves a low memory footprint compared to the other giants. The sample project provided should be good enough to get started.

To integrate XmlDataMapper all you need to do is 4 little steps

  1. Create a Business Entity / DTO for the tables
  2. Create an XML File with the mapping information between the table and the DTO.
  3. Specify the DTO and xml file in the configuration.
  4. Just call the DTOConverter.Convert(dataReader) and other such methods to convert your database record to DTO / Business Entity
Binoj Antony
A: 

je vous conseille BLtoolkit, open sourcen best practice, deus methode de connection Native et support du linq, all .net framwork, great open source, it 's the best for me

Slim