Guid linq comparison

I have a few tables that use the asp.net identifier as a foreign key and I've run into an issue when trying to get an object based on this id. It seems like Linq will not accept a straight equal between a GUID and a string which is what currently happens when I put user.Id in the filter. The suggested solution is using Guid.CompareTo(Guid), but this fails as well because I can't put a Guid object in the filter, it just is a string. Is there a known workaround to this? None of these below work because it user.Id gets set as a string and it seems Linq doesn't like that in a filter.

Filter = $@"i => i.UserID == '{user.Id}'"
Filter = $@"i => i.UserID.ComparesTo({user.Id})" }
Filter = $@"i => i.UserID == '{user.Id}'" }
Filter = $@"i => i.UserID.ComparesTo('{user.Id}')" }

Hey @kgordon,

Here is an example how to filter by GUID using Radzen query dialog:

Guid("bc992f96-065d-4e48-081a-08d861227cef")



I don't think it's getting handled properly. It may work when you put a literal string in, but when I use a variable, it's not getting translated properly. You'll see below I have a string with the Guid in it. The variable gets translated in the filter, but it doesn't put it in quotes and thus the filter fails.



You can quote the variable like this: “${yourvariable}”

Thanks that worked. I really hate dealing with Guids.