tags:

views:

664

answers:

7

I have a project that I'm currently working on but it currently only supports the .net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the "queryability" (is that even a word?) of Linq.

So far the closest is llblgen but if there was something even lighter weight that could just do the querying for me that would be even better.

I've also looked at NHibernate which looks like it could go close to doing what I want, but it has a pretty steep learning curve and the mapping files don't get me overly excited.

If anyone is aware of something that will give me a similar query interface to Linq (or even better, how to get Linq to work on the .net 2.0 framework) I'd really like to hear about it.

A: 

There's a way to reference LINQ in the .NET 2.0 Framework, but I have to warn you that it might be against the terms of use/EULA of the framework:

http://stackoverflow.com/questions/2138/linq-on-the-net-20-runtime#2146

Jon Limjap
A: 

First of all. Getting linq itself to work on 2.0 is out of the question. Its possible, but really not something to do outside a testing environment.

The closest you can get in terms of the ORM/Dynamic Querying part of it, is imho SubSonic, which I'll recommend for anyone stuck in C# 2.0

Lars Mæhlum
+4  A: 

Have a look at this:

http://www.albahari.com/nutshell/linqbridge.html

Linq is several different things, and I'm not 100% sure which bits you want, but the above might be useful in some way. If you don't already have a book on Linq (I guess you don't), then I found "Linq In Action" to be be good.

Will Dean
A: 

LinqBridge looks like a pretty nice place to start since I have VS2008, I just need to compile and deploy to a .net 2.0 server.

I've looked at SubSonic and it's also an interesting alternative, but linqbridge seems to provide a much closer fit so I'm not going to have to go and learn a new ORM / query syntax.

lomaxx
LinqBridge only gives us Linq syntax on .NET 2.0. We still need an ORM.
Thomas Eyde
+3  A: 

You might want to check out Subsonic. It is an ORM that uses an ActiveRecord pattern. I'm pretty sure most of its features work with the .NET Framework 2.0.

Lance Fisher
+1  A: 

To echo what Lance said - the SubSonic query language has a fluent interface which isn't as pretty as LINQ, but gives you some of the benefits (compile time checking, intellisense, etc.).

Jon Galloway
+1  A: 

LinqBridge works fine under .NET 2.0, and you get all the Linq extensions and query language. You need VS 2008 in order to use it, but you already knew that.

However, Linq it not an ORM. It's a query syntax. If you want to use Linq to query a database, you will need .NET 3.5. That's because 2.0 does not provide the mechanism needed to convert Linq code to your favorite database query language.

In other words, if an ORM is what you need, LinqBridge will not help you. You need to check out some of the other suggestions provided.

Thomas Eyde