views:

104

answers:

3

I'm searching for an ORM framework for .NET 2.0 (has to run on Windows 2000, so 3.0/3.5 is out) that is entirely code configured, and does not require XML. I need this to be "hard coded" in the app so that the app can be stand-alone and copied without any support files.

I've looked at most of the common ones like nHibernate and the XML requirement just won't work for me. I would also like the ability to generate the support classes via codesmith templates. I am using C# 3 on VS 2008, but I have to target .net 2.0.

Does anyone have any suggestions?

+1  A: 

There exists Fluent NHibernate, which allows you to configure nHibernate without xml mapping files.

Next to that, you can also have a look at LLBLGen.

Frederik Gheysels
Does Fluent NHibernate work on C# 2? I am under the impression that a lot of fluent interfaces use the extension method facilities of C# 3. (Yes I know, you can provide a fluent interface without extension methods ...)
froh42
Topicstarter says he wants to target .NET2.0.You can always use C# 3.0 and run under .NET2.0, and then, you can also use extension methods ... (The only thing you have to do in order to get that working, is to create the ExtensionAttribute in the correct namespace yourself).
Frederik Gheysels
Fluent NHibernate uses Linq which is unavailable with .NET 2.0. Therefore, it will not work with Windows 2000.
Matthew Talbert
Are you sure it uses LINQ ? It uses lambda expressions, which are available in .NET2.0, as long as you use C#3.0 (or higher).
Frederik Gheysels
Well, I just tried to compile it for .NET 2.0, and it doesn't compile because System.Linq isn't found. It has "using System.Linq" in several files. I haven't investigated the extent of Linq usage.
Matthew Talbert
+1  A: 

Have a look at nHibernate, again. A close look this time :-)

While nHibernate is by default configured by an external XML file it is not necessarily so.

In my project I really liked using the XML, so I kept it - but instead of saving it externally (where end users could fool around with it) I load the mapping file from an embedded resource.

Additionally there is (to my knowledge) a possibility to forego the XML and configure nHibernate using class attributes in .NET.

froh42
A: 

Take a look at Worm. It very fast and doesn't require xml. You can write mapping manualy or use attributes. It also supports POCO.

Alexey Shirshov