querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

WhereConains fails when when object is guid and contains {}

Open srenrd opened this issue 3 years ago • 0 comments

WhereConains fails when when object is guid and contains {}, e.g. {65F52295-439B-4D3D-A0E3-67563EBC514C}

var myGuid = Guid.Parse({65F52295-439B-4D3D-A0E3-67563EBC514C}); var licenseTransactionLog = new Query("CMP_LicenseTransactionLog") .Select("CMP_Log_GUID") .Where("CMP_LTL_Type", "Saved order to DB") .WhereContains("CMP_LTL_Data", myGuid); Error: System.ArgumentException: 'Expecting a non nullable string'

To fix this i have to use .ToString() on the guid.

So this code is working as intended: var myGuid = Guid.Parse({65F52295-439B-4D3D-A0E3-67563EBC514C}); var licenseTransactionLog = new Query("CMP_LicenseTransactionLog") .Select("CMP_Log_GUID") .Where("CMP_LTL_Type", "Saved order to DB") .WhereContains("CMP_LTL_Data", myGuid.ToString());

This doesn't seem logical for me, did i find a bug or is it working as intended?

srenrd avatar Jan 06 '21 10:01 srenrd