So, here's a simplified version of the situation: I have Gyms in a database:
Gym: GymID, Name
GymAmenities: GymID, AmenityID
Amenities: AmenityID
So a Gym, can have 0 to many "Amenities". Along comes a user who prioritizes amenities that are important to him or her:
UserPrefAmenities: UserID, AmenityID, Ranking
Now when searching for a gym in a zip code, I want the search results to be in order of the user preferred amenities in order of rank...
gyms = (From g In db.Gyms Where g.Zip = thisRequest.Zip Order By g.GymAmenitys.Contains(From upa In thisUser.UserPrefAmenitys Order By upa.Rank)).ToList
Or something like that...
*note that running the above results in:
Unable to create a constant value of type 'UserPrefAmenity'. Only primitive types or enumeration types are supported in this context.