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

Query by Date #3

Open
sitecorepm opened this issue Sep 10, 2013 · 2 comments
Open

Query by Date #3

sitecorepm opened this issue Sep 10, 2013 · 2 comments

Comments

@sitecorepm
Copy link

Is there a way to query by date with this library?

When I try something like:

ParseAPI.Objects.Query().Where(x => x.CreatedAt > from)

where "from" is a DateTime object

I get:

"The unary operator 'Convert' is not supported"

I've tried different combinations such as making "from" a nullable DateTime and directly accessing the "Value" of x.CreatedAt... these just result in different errors.

Thanks!

(I'm coding for WP7 or I'd use the supported library)

@sitecorepm
Copy link
Author

Never mind. I was mistaken. It does work if I use a nullable datetime for "from". The problem I think is that the JsonSerializer is not using the DateConverter for where clauses. Any particular reason for that?

@sitecorepm
Copy link
Author

I added the DateConverter to the where clause serialization. The next issue was that the CreatedAt property of the ParseObject I was trying to query was getting serialized as "CreatedAt" instead of "createdAt". I modified the WhereTranslator.VisitMemberAccess to check for a JsonProperty attribute on a member to use as the name.

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

1 participant