Skip to content

LINQ Expression for casting a primitive datatype? #2823

Answered by aboryczko
powellr0102 asked this question in Q&A
Discussion options

You must be logged in to vote

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, but ToString is a MethodCallExpression which does not support Decimal.ToString

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@powellr0102
Comment options

Answer selected by powellr0102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants