-1

i have the folloiwng code inside my asp.net mvc application:-

    var result = from userContactInfo in entities.AaaUserContactInfoes
                 join contactInfo in entities.AaaContactInfoes on userContactInfo.CONTACTINFO_ID equals contactInfo.CONTACTINFO_ID

                                          where organizationNames.Any(orgName => contactInfo.EMAILID.Split('@')[1].Split('.')[0].Contains(orgName))
                 select userContactInfo;

But i am getting the following error:-

The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities. 

So what might be causing this error?

John John
  • 1
  • 72
  • 238
  • 501

1 Answers1

4

As stated in the comments, you can't use an array when constructing an EF query. To solve this, I would recommend trying the following trickery in your where clause:

where organizationNames.Any(orgName => contactInfo.EMAILID.Contains("@" + orgName + "."))
Corey Adler
  • 15,897
  • 18
  • 66
  • 80