views:

23

answers:

2

If you have a PK Column that is not generated in any way how is it mapped?

I assumed it would be something like:

Id(x => x.PKId).Column("PKId");

But I keep getting a: Cannot insert the value NULL into column 'PKId', table 'X.dbo.DBTable; column does not allow nulls. INSERT fails.

+1  A: 
Id(x => x.Id)
  .Column("PersonId")
  .GeneratedBy.Assigned();

Taken from here, paragraph "Id".

Arnis L.
A: 

If the PK (and therefore not-nullable) column is not generated, how do you set its value?

devio
what are you talking about, you dont have to Generate a PK you can pass it in.....
peterH

related questions