Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context."
Solution of the Error:
Unable to create a constant
value of type 'System.Object'. Only primitive types or enumeration types are
supported in this context."
If in LINQ query both variable
Data Type is same then no any error throw LINQ Query.
But if the data type of the
variable is different than LINQ Query throws error.
For example, if the One Variable
Data Type is Int another is
Nullable Int then
throws the Error.
Now, for resolving the Error
we can use the Following alternatives
1) m=>m.id==id
2) m=>m.id.value.equals(id)
One of these works fine for
the query
Comments
Post a Comment