开发者

Is there a Fluent NHibernate Automapping sample project that "just works"?

开发者 https://www.devze.com 2022-12-10 13:49 出处:网络
I just started looking at NHibernate this week, and would love to use the Automapping approach on my current project.

I just started looking at 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 lates开发者_Go百科t NHibernate code?


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.


Whocanhelpme based on S#arp architecture.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号