Help me please, i’m new…
this is my GanttInitializer code:
public class GanttInitializer : DropCreateDatabaseIfModelChanges
{
protected override void Seed(GanttContext context)
{
List tasks = new List()
{
new Task() { Id = 4, Text = “test1”, StartDate = DateTime.Today.AddDays(-3), Duration = 18, SortOrder = 10, Progress = 0.4m, ParentId = null },
new Task() { Id = 2, Text = “task test 1”, StartDate = DateTime.Today.AddDays(-2), Duration = 8, SortOrder = 10, Progress = 0.6m, ParentId = null },
new Task() { Id = 3, Text = “task test 2”, StartDate = DateTime.Today.AddDays(-1), Duration = 8, SortOrder = 20, Progress = 0.6m, ParentId = null }
};
tasks.ForEach(s => context.Tasks.Add(s));
context.SaveChanges();
List<Link> links = new List<Link>()
{
new Link() { Id = 1, SourceTaskId = 1, TargetTaskId = 2, Type = "1" },
new Link() { Id = 2, SourceTaskId = 2, TargetTaskId = 3, Type = "0" }
};
links.ForEach(s => context.Links.Add(s));
context.SaveChanges();
}
}
And when I see it in the browser. I see this:
What is the problem?