I have a price range query I'm trying to write for my C# code and depending on the currency type of the product I need to query the correct field
var minPrice = builder.Gte(s => s.Price.CurrencyCode == "USD" ? s.Price.Usd : s.Price.Foreign, filter.MinPrice);
var maxPrice = builder.Lte(s => s.Price.CurrencyCode == "USD" ? s.Price.Usd : s.Price.Foreign, filter.MaxPrice);
but when I run the code to test this I get the following error:
Unable to determine the serialization information for s => IIF((s.Price.CurrencyCode == ""USD""), s.Price.Usd, s.Price.Foreign).
if I take the ternary out and just look for the US price it works perfectly, but I need to be able to have it look for non US prices as well, am I doing something wrong?