Relative Content

Tag Archive for asp.net-coreasp.net-identity

How to update the LastLogin field in the AspNetUsers table

I have implemented razor view based identity in asp.net core 6. The logging works fine. However, whenever someone logs in, I want the LastLogin field in the AspNetUsers table to be updated with the login date. However, it always stays at 0001-01-01 00:00:00.0000000. The following is the code by which the logging takes place in the Login.cshtml.cs page.