Problem displaying data

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?

Hello,

I do not see in your data values for fields, where displayed “undefined” at the screenshot.
See example:
docs.dhtmlx.com/gantt/snippet/be71bf5d

Thank it works! Now , how i can display data from my database

Hi,
you have to convert your entities into format that could be parsed by dhtmlxGantt.
You can either map task and links to anonymous classes like shown here in “Step 3 – Loading Data”
dhtmlx.com/blog/using-dhtmlx-gan … p-net-mvc/

Instead of anonymous class you could define a separate model for client-side gantt in order to make use of model binding in CRUD actions and convert data between backend model and view model using AutoMapper or something similar