You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Throwing the exception): System.Linq.Dynamic.Core.Exceptions.ParseException: 'Operator '<=' incompatible with operand types 'BsonValue' and 'DateTime''
BsonValue is the actual type of BirthDate and is wrapping DateTime. I have tried to get the actual DateTime value, such as:
But receive a different exception: System.InvalidOperationException: 'The operands for operator 'LessThanOrEqual' do not match the parameters of method 'op_LessThanOrEqual'.'
Any thoughts, suggestions here?
I don't have issues with simple expressions such as: IQueryable query1 = collection.AsQueryable<BsonDocument>().AsQueryable().Where("FirstName == \"John\"");
The text was updated successfully, but these errors were encountered:
I'm running into an issue when trying to use System.Linq.Dynamic.Core with MongoDB's client.
Example)
Works
IQueryable query1 = collection.AsQueryable<BsonDocument>().AsQueryable().Where("Birthdate <= @0", DateTime.Now);
Doesn't Work:
IQueryable query1 = collection.AsQueryable<BsonDocument>().AsQueryable().Where("Birthdate <= DateTime.Now");
(Throwing the exception): System.Linq.Dynamic.Core.Exceptions.ParseException: 'Operator '<=' incompatible with operand types 'BsonValue' and 'DateTime''
BsonValue is the actual type of BirthDate and is wrapping DateTime. I have tried to get the actual DateTime value, such as:
IQueryable query1 = collection.AsQueryable<BsonDocument>().AsQueryable().Where("Birthdate.AsDateTime <= DateTime.Now");
But receive a different exception: System.InvalidOperationException: 'The operands for operator 'LessThanOrEqual' do not match the parameters of method 'op_LessThanOrEqual'.'
Any thoughts, suggestions here?
I don't have issues with simple expressions such as:
IQueryable query1 = collection.AsQueryable<BsonDocument>().AsQueryable().Where("FirstName == \"John\"");
The text was updated successfully, but these errors were encountered: