I have a LoginRecord table in sqlserver 2008 with the following column structure-
LoginId - int, identity
UserId - int
LoginDateTime- Allow nulls false,default value getdate()
I am inserting new record by entity framework 6 as below-
db.LoginRecords.Add(new LoginRecord() { UserId = UserId });
db.SaveChanges();
But in LoginDateTime table, null value is being inserted. It supposed to be current datetime.
I am using database first approach.
How can overcome this issue?

new LoginRecord() { UserId = UserId, LoginDateTime = null });