One thing that is worth mentioning first is that this is FluentNhibernate, a project that lets you store your nhibernate configuration in code using the example you used above. There's quite a bit of documentation on the website.
That said, I'll give you a few quick pointers to get you started:
There's an Id method in ClassMapping, but I how no idea what possible parameters it can take or what the map class is doing.
the Id Method takes an
Expression<Func<T, object>>, which lets the code underneath get an expression tree that represents your id field. In the simple case you've got it will take the expression tree and generate an identity mapping like this (if you were doing this using the xml config. this is also a guess and might be wrong):
<id name="Id"><generator class="native" /></id>
You can also use composite ids, like this:
.KeyProperty(t => t.Cat)
.KeyProperty(t => t.Color)
.KeyProperty(t => t.Name);
Further more, what is the x=> x.ID doing? From what I understand it should say that the reference to x goes to x.id, but x is used all over the place!?!
I recommend reading up expression trees to get a good understanding of what they can do, so you can see how lambda expressions can be used to get information about your object graph. The
x is just a place holder for the object that the lambda expects, which is typed by the generic parameter passed to
ClassMap<T>. So the
x is a
T, in your case a
Customer, which can be inspected by the expression tree parser.
I hope this helps!