LINQ Expression for casting a primitive datatype? #2823
-
The ERP software my company uses exposes all of its API endpoints as OData services. I'm attempting to extend the UI with a custom view that emulates how end-users are able to compose queries at runtime. I'm trying to write a LINQ expression that will generate the following OData Filter where The expression Is this possible or would I need to find another way to accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I tried the following expression: |
Beta Was this translation helpful? Give feedback.
I tried the following expression:
x => ((string)((object)x.ManufLeadTime)).Contains("1");
and it produced
contains(cast(ManufLeadTime,Edm.String),'1')
the client does support casting by means of
ConvertExpression
, butToString
is aMethodCallExpression
which does not supportDecimal.ToString