Skip to content

The query specified in the URI is not valid. The binary operator GreaterThanOrEqual is not defined for the types 'System.Nullable1[System.DateOnly]' and 'System.Nullable1[System.DateTimeOffset]'. #989

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

Open
aowesat opened this issue Jul 16, 2023 · 2 comments
Assignees
Labels
bug Something isn't working investigating

Comments

@aowesat
Copy link

aowesat commented Jul 16, 2023

Assemblies affected
ASP.NET , OData 8.2.0

Describe the bug
The query specified in the URI is not valid. The binary operator GreaterThanOrEqual is not defined for the types 'System.Nullable1[System.DateOnly]' and 'System.Nullable1[System.DateTimeOffset]'.

Reproduce steps
http://localhost:5000/odata/Student?$filter=(CREATION_DATE ge 2020-01-01)

Data Model
Please share your Data model, for example, your C# class.

EDM (CSDL) Model
{
"$Version": "4.0",
"$EntityContainer": "Default.Container",
"Dynamic.Objects.d81b92f4-c077-44d2-98e1-85858764a468.Relations": {
"Student": {
"$Kind": "EntityType",
"$Key": [
"Id"
],
"Id": {
"$Type": "Edm.Guid"
},
"CHANGE_DATE": {
"$Type": "Edm.Date"
},
"CHANGED_BY": {
"$Type": "Edm.TimeOfDay",
"$Precision": 0
},
"CREATED_BY": {
"$Type": "Edm.TimeOfDay",
"$Precision": 0
},
"CREATION_DATE": {
"$Type": "Edm.Date"
}
}
},

"Default": {
    "Container": {
        "$Kind": "EntityContainer",
        "Student": {
            "$Collection": true,
            "$Type": "Dynamic.Objects.d81b92f4-c077-44d2-98e1-85858764a468.Relations.Student"
        }
    }
}

}

Request/Response
http://localhost:5000/odata/Student?$filter=(CREATION_DATE ge 2020-01-01)
Please share your response head, body.

Expected behavior
get result according to filter fine.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Please share your call stack or any error message
Add any other context about the problem here.

@aowesat aowesat added the bug Something isn't working label Jul 16, 2023
@KenitoInc
Copy link
Contributor

Share your C# model class

@aowesat
Copy link
Author

aowesat commented Jul 19, 2023

public class Student {
public int Id {get;set;}
[Column(TypeName = "date")]
public DateTime? CREATION_DATE {get;set;}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigating
Projects
None yet
Development

No branches or pull requests

3 participants