I have a query which works fine
var queryItems = rawQuery.ObsDataResultList.AsQueryable().Where("Name = @0 AND AuthoredDate = @1" +, selectedItem, dateKey).ToList();
I want to update the query to
var queryItems = rawQuery.ObsDataResultList.AsQueryable().Where("Name = @0 AND AuthoredDate = " + dateKey.ToString(), selectedItem).ToList();
Note the only thing I changed was removing the identifier. Now, I receive Error
Operator '=' incompatible with operand types 'DateTime?' and 'Int32'
How can I fix the error without reverting back to the original query?
You are missing quotes:
.Where("Name = @0 AND AuthoredDate = \"" + dateKey + "\"")
It seems like a really bad idea to spoil your code like this though. Your original query seems much better.