5

I am assigned to maintain a bunch of legacy apps with heavy stored procedure usage built before '05 when there was no ORM. The developers who work with me don't know Entity Framework nor LINQ and are not eager to learn.

Is there any ORM on .NET that provides a simple object interface to existing database tables and perhaps stored procedures?

I am quite happy if it enables me to code a few lines to get a class to each table, and it has properties corresponding to data in each column and some methods or properties to resolve foreign key relationship / many-to-many relationship - forward and reverse.

For example, saving one employee and department record

Employee e = new Employee("John", null);
Department d = new Department("QA");
d.save();
e.department = d;
e.save();

without writing INSERT SQL statements.

EDIT: I am using MS SQL Server 2008

kakarukeys
  • 21,481
  • 10
  • 35
  • 48
  • See my Q again, LINQ doesn't appeal to the developers I work with. – kakarukeys May 20 '11 at 17:13
  • All you said was that they were not eager to learn. That does not mean that Linq is a bad choice. Without a single line of code you can get all your properties and classes from the tables – Oskar Kjellin May 20 '11 at 18:37
  • Choosing a .NET ORM: http://stackoverflow.com/questions/1377236/nhibernate-entity-framework-active-records-or-linq2sql/ – Michael Maddox May 21 '11 at 11:36
  • I would question the fact that they "are not willing to learn". What kind of developers are they? Surely by learning they will be expanding their knowledge base and become more employable in the future. Just a thought. – Piers Karsenbarg Feb 15 '13 at 11:00
  • 1
    right! I have left the company :) – kakarukeys Mar 04 '13 at 01:54

5 Answers5

4

Have a look at Rob Conery's Massive. It's simple and appears easy to use. It looks like it requires .NET 4, though.

SquidScareMe
  • 3,108
  • 2
  • 24
  • 37
3

SubSonic is fairly easy to use. LINQ to SQL is a good choice too. Also, take a look at http://www.codeproject.com/KB/database/LightORMLibrary.aspx.

Kamyar
  • 18,639
  • 9
  • 97
  • 171
3

I suggest you to use PetaPoco, the quite fresh ORM with easy to learn line.

From authors site:

PetaPoco was original inspired by Rob Conery's Massive project but for use with non-dynamic POCO objects. It came about because I was finding many of my projects that used SubSonic/Linq were slow or becoming mixed bags of Linq and CodingHorror.

I needed a data acess layer that was tiny, fast, easy to use and could run on .NET 3.5 and/or Mono 2.6 (ie: no support for dynamic expandos). Rob's claim of Massive being only 400 lines of code intruiged me and I wondered if something similar could be done without dynamics.

Community
  • 1
  • 1
Dariusz
  • 15,573
  • 9
  • 52
  • 68
0

I used Subsonic in .NET 2.0 projects and it was nice. Unfortunately, it seems, it is not developed anymore.

elder_george
  • 7,849
  • 24
  • 31
0

NHibernate may be something to look into also, though personally I didn't like the original Java Hibernate very much, but that was years ago. I also use SubSonic on a regular basis. The latest SubSonic is more Linq oriented, but look specifically at its "ActiveRecord" capability. I think it covers the object-based stuff that you are trying to do. Development on SubSonic doesn't happen much any more, other than occasional bug fixes, but it is open source, and there is a Google group for support questions. It also supports a good number of databases, since you didn't mention what DB you are using.

CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138