another new comer question
given i have a this
<id name="Id" column="PersonID" type="Guid">
<generator class="assigned"></generator>
</id>
in my Person.hbm.xml
how is this represented in fluent?
I have this
Id(x => x.Id); which does not work. I'll take a good guess that is because Id is not a field in the Person table...
thanks
KES
Comments are currently closed for this discussion. You can start a new one.
2 Posted by David R. Longnecker on 24 Feb, 2010 10:05 PM
Id and Map both have an overload that allows you to specify the column names.
Id(x => x.Id, "PersonID");
For specifying the GeneratedBy, you can continue the chain:
Id(x => x.Id, "PersonID").GeneratedBy.Assigned();
If your Type in your class is a Guid, it should pass that along with the map automatically.
More information on the wiki: http://wiki.fluentnhibernate.org/Fluent_mapping#Id
3 Posted by YankeeImperialistDog on 24 Feb, 2010 10:15 PM
That's what's cool about new comer questions. In general they are easy, the answer intuitive, and the questioner (me), is left with a "Oh, yeah, of course" feeling.
Thanks!
very appreciated.
KES