I am new to Entity Framework, but maybe something is misunderstood or something is wrong.
My code to get a list of tasks for a specific person:
public List<TaskObject> GetAssignedTasks(int personId)
{
var items = (from s in _te.tasks where s.person.person_id == personId select s).ToList();
var tasks = new List<TaskObject>();
foreach (var t in items)
{
TaskObject tk = Transformer.UnpackTask(t);
tasks.Add(tk);
}
return tasks;
}
My problem is that it returns a list of records, but related items are not loading. My Transformer.UnpackTask method accepts the task object that I downloaded, and then converts it to another object that goes to the user interface through the business / service levels.
Unpacker , (, "AssignedPerson", Person . AssignedPerson NULL , .
?