Sunday, December 31, 2017

How do I create timestamps on model create/update?

I am fairly new in the Dotnet world (coming from Laravel mostly). I am using Dotnet Core 2 on a project and I need to add two columns that show (1) when the row was created and (2) when the row was updated. I can do this manually for each processing, but I would like to keep it all contained somewhere so I don't forget.

At the moment, I have a BaseModel setup that I am assigning to all of my other models - just a simple public DateTime? CreatedAt { get; set; } and public DateTime? UpdatedAt { get; set; }

Any tips?

How do I create timestamps on model create/update? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team