0

Is there any EF Model-First approach to populate LastModified column to GetDate() function in database.

Most of my searches took me to code-first alternatives. But could find Model-First approach. I see StoreGeneratedPattern = Computed in properties window.

Can you please tell me how to use this to populate date using GetDate () function in database.

Community
  • 1
  • 1
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
  • GETDATE() is a sql server function...EF is C#...are you trying to tell sql server to generate the date or is your application going to generate the date and then send it to sql server? – BillRuhl Dec 23 '14 at 23:01
  • @BillRuhl, Telling SQL server to generate the date. – Abhijeet Dec 24 '14 at 04:30

1 Answers1

0

Check my answer here, I believe you need to do same thing to Because eventually your date property needs to be set from the C# code, Or you can do it from the database level through triggers for example.

Community
  • 1
  • 1
Omar.Alani
  • 4,050
  • 2
  • 20
  • 31