You have many ways for solving. Simplest, as i think, will be change your query like this
var result = source.Entities.Where("CompanyId.Equals(@0)", new object[] { Guid.Parse("838AD581-CEAB-4B44-850F-D05AB3D791AB") });
If you want use operators =
and ==
then in Dynamic.cs
you need change interface IEqualitySignatures : IRelationalSignatures
like this
interface IEqualitySignatures : IRelationalSignatures
{
....
F(Guid x, Guid y);
....
}
after that you can use next query
var result = source.Entities.Where("CompanyId=@0", new object[] { Guid.Parse("838AD581-CEAB-4B44-850F-D05AB3D791AB") });
OR
var result = source.Entities.Where("CompanyId==@0", new object[] { Guid.Parse("838AD581-CEAB-4B44-850F-D05AB3D791AB") });
But if you want use string
parameter you need change ParseComparison
method in ExpressionParser
class. You need add yet another checking for operand types like this
....
//you need add this condition
else if(left.Type==typeof(Guid) && right.Type==typeof(string)){
right = Expression.Call(typeof(Guid).GetMethod("Parse"), right);
}
//end condition
else {
CheckAndPromoteOperands(isEquality ? typeof(IEqualitySignatures) : typeof(IRelationalSignatures), op.text, ref left, ref right, op.pos);
}
....
and then you query will be work
var result = source.Entities.Where("CompanyId = @0", new object[] { "838AD581-CEAB-4B44-850F-D05AB3D791AB" });