One way is to add a constructor and set the default value there:
[TableName("AdminNotification")]
[PrimaryKey("id", autoIncrement = true)]
[ExplicitColumns]
public class AdminNotification
{
[Column("id")]
[PrimaryKeyColumn(AutoIncrement = true)]
public int id { get; set; }
[Column("dateTime")]
public DateTime dateTime { get; set; }
[Column("adminNotificationTypeId")]
public int adminNotificationTypeId { get; set; }
public AdminNotification(){
dateTime = DateTime.Now;
}
}
Depending on the way you create and insert the object, the value will be showing the time of creation of the AdminNotification, not the time it has actually been written to the database, but most of the time the difference is negligible and won't make a difference.