c# - select list of related grandchild entities -


trying ienumerable workorderheader given following table structure:

orderheader 1:many orderdetails orderdetail 1:1 workorderheader 

code:

public ienumerable<workorderheader> getinprocessworkordersfororderby(orderheader orderheader) {     var orderdetails = orderheader.orderdetails;     var workorders= orderdetails.select(od => od.workorderheaders.where(woh => woh.statusid < (int)workorderstatus.complete));     return workorders; } 

this returning nested ienumerable<ienumerable<workorderheader>>. how inner ienumerable<workorderheader>?

i think looking selectmany

var workorders= orderdetails.selectmany(od => ...) 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -