Usage Contains in LINQ for & ldquo; IN & rdquo; Clause - Different between strings and bytes


I'm trying to create a LINQ query to pull specific subTypes, which are stored as Bytes in the table. I've tried several variations, and got it working forcing in and out of strings; but I can't get a numeric version to work. I assume it's some sort of c# rule I don't properly understand, but I'm not sure where to look. Any suggestions?

// This works okay, but doesn't makes sense to go in/out of string

string[] subTypes = { "2", "4" };      //  2 = Clinic, 4 = SubClinic
var clinics = from o in db.Locations
         where subTypes.Contains(o.LocationType.ToString())
        select o.Name;

// this version shows an error on the "where" clause
// byte[] does not contain a definition for 'Contains'...

byte[] subType = { 2, 4 };      //  2 = Clinic, 4 = SubClinic
var clinic = from o in db.Locations
        where subType.Contains(o.LocationType)
       select  o.Name;

So when I tried:

byte[] subType = { 2, 4 };
var locationType = 2;

I got the same error as you did. Changing the code to:

byte[] subType = { 2, 4 };
var locationType = (byte)2;

It worked fine. Is it possible that the LocationType is not a byte but an int?