This question is locked. New answers and comments are not allowed.
Hi,
I need to update a DateTime property only when an object is saved to database. This is a sort of timestamp fields that tells when last modification occurred and i would like to not use triggers to do this.
Right now i handle it manually setting explicitly the DateTime.Now just before calling the context SaveChanges().
It would be nice to have this handled automatically, that is having the context to update that property just before (and only) when ctx.SaveChanges() occurs.
Is There a way to do this?
thank you
AndreaT
I need to update a DateTime property only when an object is saved to database. This is a sort of timestamp fields that tells when last modification occurred and i would like to not use triggers to do this.
Right now i handle it manually setting explicitly the DateTime.Now just before calling the context SaveChanges().
It would be nice to have this handled automatically, that is having the context to update that property just before (and only) when ctx.SaveChanges() occurs.
Is There a way to do this?
thank you
AndreaT