You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each parameter is a pair of expressions separated by a colon (:), where the first expression – the condition – MUST be a Boolean expression, and the second expression – the result – may evaluate to any type.
The case function evaluates the condition in each pair, starting with the leftmost pair, and stops as soon as a condition evaluates to true. It then returns the value of the result of this pair. It returns null if none of the conditions in any pair evaluates to true. Clients can specify a last pair whose condition is true to get a non-null “default/else/otherwise” result.
Clients SHOULD ensure that the results in all pairs are compatible. If all results are of the same type, the type of the case expression is of that type. If all results are of numeric type, then the type of the case expression is a numeric type capable of representing any of these expressions according to standard type promotion rules.
Services MAY support case expressions containing parameters of incompatible types, in which case the case expression is treated as Edm.Untyped and its value has the type of the parameter expression selected by the case statement.
Example 97: compute signum(X)
$compute=case(X gt 0:1,X lt 0:-1,true:0) as SignumX
@savicarlone1977 This is a feature gap and we have added the issue to our backlog. However, we do welcome contributions so if this is a feature you might have room to work on we'd very happy to review the pull request.
CASE is not working at all in $compute and $filter clauses
Assemblies affected
OData .Net lib 8.0.7
Reproduce steps
Call OData V4 service built using NET 6 and try a $compute with CASE clause
Expected result
Tha additional field
Actual result
Exception in parser
The text was updated successfully, but these errors were encountered: