Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhereConains fails when when object is guid and contains {} #440

Closed
srenrd opened this issue Jan 6, 2021 · 1 comment
Closed

WhereConains fails when when object is guid and contains {} #440

srenrd opened this issue Jan 6, 2021 · 1 comment

Comments

@srenrd
Copy link

srenrd commented Jan 6, 2021

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?

@ahmad-moussawi
Copy link
Contributor

This is the expected behavior, since it expects a string and you are passing a Guid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants