0

So I have a small table and one of the columns is a date, with a a default GETDATE() constraint for use as a timestamp.

Neither the model, nor the ViewModel have a property for this date, but I have an edmx file, so obviously it does. I don't capture the date at any point in the app.

The issue is that when the changes are submitted to the db, the model contains the date '0001-01-01' and this is overwriting the default in the db.

Is there some way to ignore date from the client side?

BattlFrog
  • 3,370
  • 8
  • 56
  • 86

1 Answers1

1

You need to set StoreGeneratedPattern to Computed on that property in the EDMX. See a related question here.

Community
  • 1
  • 1
sinelaw
  • 16,205
  • 3
  • 49
  • 80
  • That was it, thanks. I dont have enuff rep to vote for your answer but I am making a list and will come back through when I do. – BattlFrog Oct 17 '12 at 22:26