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}')" }