Hi I am trying to write a linq query in web api using etity framework. I have two entities
MainProj task_list
p_id t_id
p_name p_id
--------- t_name
navigation properties -------------------
task_list navigation properties
mainProj
MainProj has 1 to many relation with task_list I am using following linq query
var list=( from z in MainProj
select new pList
{
proj_name=z.p_name
proj_id=z.p_id
newtasklist = new List<newtasklist>
{
new newtasklist {
task_list=z.task_list.(** cant access the properties from task_list here)
}}
});
classes are
public class pList
{
public int p_id { get; set; }
public string p_name { get; set; }
public IEnumerable<newtasklist> newtasklist { get; set; }
}
public class newtasklist
{
public int t_id { get; set; }
public string t_name { get; set; }
public int p_id { get; set; }
public pList pList {get; set;}
}
Please let me know how i can access task_list properties at this line in linq query
task_list=c.task_list.(** cant access the properties from task_list here)

newtasklistto contain?task_listin thenewtasklist = new List<newtasklist> { new newtasklist { task_list=z.task_list??task_listis not a member of thenewtasklistclass