Basically, in my EF database I have added a DateTime row to my table using EF code first.
Here's how it is now:
public class Employee
{
[Key]
public int Id { get; set; }
public DateTime Date { get; set; } //this has been added
}
As you see the Date is not nullable - therefore I need to initially populate the dates when I run the migration.
Here's the generated migration script:
public partial class Changed_Employee : DbMigration
{
public override void Up()
{
AddColumn("dbo.Employees", "Date", c => c.DateTime(nullable: false));
}
}
The thing is, I would like to run some custom C# logic in order to determine the exact date of each individual "Employee".
However, how would I do this?