views:

32

answers:

1

I am using Entity Framework 4.0

Many of our tables have a column called RowID, used by the DBA to track stuff. The column is NON NULLABLE has a database default value that maps to a function.

The problem is, the EDMX Model requires this property to have a value on the Entity, making construction of the object difficult.

I have read many posts on tweaking the EDMX and SSDL files manually to make this work. That is not feasible for our team.

Is there a better solution to this problem, other than making the column NULLABLE in the database? I don't care about getting the value back, I just want the database to be able to set it on its own.

A: 

If RowID never needs to be read or written in the context of your application then it doesn't belong in your Entity Model at all. Just remove it from your Entity Model using the Designer (Right Click > Delete) and let the database manage it.

willbt
The problem is the RowID is a FK on other tables, so I need to be able to get it and use it when creating child entities.
Matthew