I had several queries that look like the two examples below:
// Example 1:
var dataSeries = (from d in DataSeries
where d.Symbol == symbol
select d).FirstOrDefault();
// Example 2:
return Markets.Where(m => m.DataSeries == dataSeries).ToArray();
Which was working just fine until I ran "Update model from Database...". Now, I'm getting a NotSupportedException:
Unable to create a constant value of type 'MyTest.Symbol'. Only primitive types or enumeration types are supported in this context.
Yes, I verified that symbol and d.Symbol (and m.DataSeries and dataSeries) are of the same types.
And yes, I can change my query to use P/F key relationships like so:
var dataSeries = (from d in DataSeries
where d.Symbol.Id == symbol.Id
select d).FirstOrDefault();
But I really don't want to have to change all my code to P/F key relationships when object relationships was working just fine.
Question: How do I get my first examples working again?