Skip to content

Commit

Permalink
Always set date updated when creating
Browse files Browse the repository at this point in the history
  • Loading branch information
Thundernerd committed Jan 20, 2025
1 parent f466efe commit 7bc7562
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions DataStore/BasicRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public TModel Insert(TModel model)
public TModel Insert(TModel model, DateTimeOffset dateCreated)
{
model.DateCreated = dateCreated;
model.DateUpdated = dateCreated;
EntityEntry<TModel> entry = _set.Entry(model);
entry.State = EntityState.Added;
_database.SaveChanges();
Expand Down

0 comments on commit 7bc7562

Please sign in to comment.