I need some tutorials on how to get started with nHibernate and Fluent nHibernate. I'm coming from an Entity Framework background (which seems easier to use). I've tried sites like http://www.summerofnhibernate.com/ to get a grasp on nHibernate itself, but it seems outdated.
I'd like to generate a mapping of my database tables (al la Entity Framework), and do simple CRUD using nHibernate. I'm also using ASP.NET MVC and Visual studio 2010. Thanks.
Fluent NHibernate offers an alternative to NHibernate's standard XML mapping files. Rather than writing XML documents, you write mappings in strongly typed C# code. This allows for easy refactoring, improved readability and more concise code.
EF Core can use a ROWVERSION/TIMESTAMP column on SQL Server, or any of a list of columns, when updating a record. NHibernate offers richer capabilities, besides SQL Server ROWVERSION/TIMESTAMP, it can also use database native mechanisms such as Oracle's ORA_ROWSCN, but also timestamp or version columns.
Although a few years old, Summer of NHibernate concepts are pretty much intact and that's what it teaches you best. If you're a patient learner, start there.
On the side of Fluent NHibernate, the best tutorial is still the official one. The minor gripe it has is that it assumes that you're coming from an NHibernate raw background, so it's not particularly great explaining how to configure NHibernate (i.e. installing binaries for it and any given database). Edit: See Update at the bottom.
NHibernate books: NHibernate 3.0 Cookbook.
Update: NHibernate can now be easily configured using NuGet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With