Is there a way to throw a query inside a subclass?
If I requested only one subclass, I would do
auctions.OfType<AuctionBid>().Where(auctionBid => auctionBid.AuctionBidProp)
Now I would like to make a case by type of subclass
auctions.Where(auction =>
(auction is AuctionBid) && ((AuctionBid) auction).Prop == 1
|| (auction is AuctionBuy) && ((AuctionBuy) auction).Prop == 1)
Is there any way to do this?
Of course, the above line gives an error: LINQ to Entities only supports listing EDM primitives or enumeration types.
source
share