Populate Column Default Value Inside Database Entity Framework Model First

794 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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.