views:

784

answers:

3

I just started looking a NHibernate this week, and would love to use the Automapping approach on my current project.

I'm working with Fluent NHibernate 1.0.0.594, which I downloaded a few days ago.

I found the Examples.FirstProject in the NHibernate source code, which uses the older style entity mapping. This has been tremendously valuable for me as an introduction to NHibernate, because it works right out of the box.

However, I've been unable to find a similar standalone working example for AutoMapping. Peter Bromberg posted a sample that looks good, but it seems to be missing some important assemblies. He's been helping me try to resolve the problems, but it's not working yet.

Next, I attempted to modify the Examples.FirstProject program to use Automapping, but immediately ran into problems with exceptions being thrown that I just don't understand at my current level of experience.

Can anyone point me to an Automapping sample project that is known to work with the latest NHibernate code?

A: 

Soon after I posted my question, I found Gabriel Schenker's 3 part series Your very first NHibernate application while browsing some of the other SO questions with Automapper tags.

Part 3 has a sample project that creates a database (either SQL Server CE or SQLite) using Automapping. This sample worked for me with absolutely no problems.

In addition, all three articles in the series are well worth reading.

But if anyone can suggest some other samples, I'd still be interested.

Edit: Since posting this answer, I've found that Gabriel Schenker's project used an older syntax that is now obsolete.

Tom Bushell
+3  A: 

I've started a small project doing what you've asked for: small sample demoing the fnh concepts "in action" Fluent NHibernate samples CodePlex project

I just started it (there would be much more code there in the future), but it has already initial auto mapping example so go check it out and I hope it could be of some help to you.

Nikola Malovic
Accepted answer. Here's the note I left on Nikola's blog:Nikola,This is a great explanation, and your sample project is the ONLY one I've been able to find that you can download, and it "just works".My only (slight) reservation is that it might be a bit intimidating for the FNH newbie (like me) who probably would be content to use the default conventions, and may not need subclassing, etc.On the other hand, it's great that you demonstrate these more advanced techniques in a complete, working example.Nice job!
Tom Bushell
I have a much simpler sample project working now, which I will try to make available on the Fluent NHibernate wiki.
Tom Bushell
A: 

Whocanhelpme based on S#arp architecture.

Cherian

related questions