var code = sqlXrm.Scalar<MetadataEntity, int>(e => e.ObjectTypeCode, e => e.LogicalName == "inno_subject");
var code2 = sqlXrm.Scalar<MetadataEntity, int>(e => e.ObjectTypeCode, e => e.LogicalName.Equals("inno_subject"));
“code” matches but “code2” does not.
The debug output is…
DEBUG: SQL: SELECT "ObjectTypeCode"
FROM "MetadataSchema"."Entity"
WHERE ("LogicalName" = @0)
PARAMS: @0=inno_subject
DEBUG: SQL: SELECT "ObjectTypeCode"
FROM "MetadataSchema"."Entity"
WHERE "LogicalName"=@0
PARAMS: @0=inno^_subject
When using .Equals it’s inserting the ^ before the underscore which is causing the WHERE clause not to match.
I realise I could just use == but I’ve used .Equals in a bunch of places already.
Any ideas?