using(SampleEntities entities = new SampleEntities()) {
var userMap = from ad in entities.SampleGroupsSet
from uid in distinctUserIDs
where ad.ShortUserID.ToLower() == uid.ToLower()
select new {shortID = uid, longID = ad.UserID};
string userID = "sampleId";
var longIDs = from map in userMap
where map.shortID.ToLower() == userID.ToLower()
select map.longID;
if (longIDs != null && longIDs.Count() > 0)
{
...
}
...
I'm running into an issue where if I am querying for the Count of longIDs I'm getting an exception:
"Unable to create a constant value of type 'Closure type'. Only primitive types ('such as Int32, String, and Guid') are supported in this context."
Has anyone encountered this? Thanks.