I have the following code:
var qry = from sv in Context.DocStore_SearchValues
where sv.Category == category
select sv;
return qry.FirstOrDefault() != null;
I am getting this message:
Unable to create a constant value of
type
‘SSS.Model.Suburban.DocStore_Category’.
Only primitive types (‘such as Int32,
String, and Guid’) are supported in
this context.
How do I check for null? I tried as a string and I got the same message:
return string.IsNullOrEmpty(qry.FirstOrDefault().ToString());
Any suggestions?
Thank you!
Eroc
You cannot use a non-primitive type in the
whereclause.Change it to something like