If I want my object to reference a “foo” object using the “foo_key” field I code it like this:
References(x => x.foo)
.Column(“foo_key”);
My problem with this is that I much prefer the compile-time safety of fluent, and I hate seeing that hard-coded string “foo_key”, when I know that there is a property of that same name. I would like instead to use this:
References(x => x.foo)
.Column(x=> x.foo.foo_key);
Am I missing something in Fluent nHibernate? Should this not be possible, and strongly desired?
Column is not a property, it is the name of the column in the database. It must be a string.