?: Operator in LINQ Query

后端 未结 5 2031
时光取名叫无心
时光取名叫无心 2021-02-20 15:20
  • How do I utilize a ?: operator in the SELECT clause of a LINQ query? If this can\'t be done, how can I emulate one? The goal is to get a CASE block in my select claus

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-20 16:13

    You have to use the join keyword, and define the relationship between the entities in order to make a proper inner join.

    Here you can find some examples about that, I also highly recommend you to get LinqPad, its a really valuable tool for testing your queries, also its very good to learn, it has 200+ examples.

提交回复
热议问题