linq で次の SQL クエリを複製しようとしています。
Select
l.*,
ISNULL( i.InterestPercentage,0)
as InterestPercentage
FROM properties l
LEFT JOIN interest i on i.ListingKey = l.ListingKey
Where i.userId = {0}
現時点では、あまりやることがありません。
var results = from l in context.properties
join s in context.interest on l.ListingKey equals s.ListingKey
where s.userId == "";
これは完全な結合を返しますが、1 つの追加値であるInterestPercentage
. InterestPercentage の追加プロパティを持つプロパティのすべての列である新しいオブジェクトを作成する必要があると思います。次に、追加しselect new MyObject { tons of property setters }
ます。
さらに、Odata を介してこれを公開しようとしていますが、これを行うとクエリ可能な機能が失われますか?