John Stuart
John Stuart

Reputation: 333

Fluent NHibernate : References a null

The title may be confusing so ill try to elaborate. I have a business object that tracks time for either a manifest or an office. So in my database i have two columns, both are nullable, but only one can be not null. In my mapping i have

References(x=>x.Manifest, "ManifestId").Cascade.All();
References(x=>x.FieldOffice, "FieldOfficeId").Cascade.All();

Which is causing an error. My question then is this: Is it possible to map this way if the foreign key is null?

Sorry if this is confusing. :S

Upvotes: 2

Views: 2787

Answers (1)

John Stuart
John Stuart

Reputation: 333

Figured it out. Nmind.

References(x=>x.Manifest, "ManifestId").Nullable().Cascade.All();

was doing it in the wrong order.

Upvotes: 3

Related Questions