Linq-to-Entities: LEFT OUTER JOIN with WHERE clause, calculation and projection

前端 未结 2 1714
你的背包
你的背包 2021-01-25 00:07

I\'m having a very difficult time figuring out how to translate a simple SQL LEFT OUTER JOIN on multiple columns and a where clause into a working Linq-to-Entities query. There

2条回答
  •  死守一世寂寞
    2021-01-25 00:39

    With entities you have a container and assess your tables by their name. This where clause filters results by a fields value and can be concatenated with more values. The parts in {} are for you to change to match your entities. This query is an IEnumerable(Of {your entity})- great for databinding.

    Dim query = model.{table name}.Where(Function(o) o.{column name} = {some value}).ToList()
    

提交回复
热议问题