F# Query Expression “The field, constructor or member 'Contains' is not defined”

StackOverflow https://stackoverflow.com/questions/13034851

  •  13-07-2021
  •  | 
  •  

سؤال

I'm trying to get this example from the Query Expressions page to work. I've got the database setup and I've made many small bits of code work.

    let idQuery = query { for id in [1; 2; 5; 10] do
                  select id }

    query { 
       for student in db.Student do
       where (idQuery.Contains(student.StudentID))
       select student
    }

But all I get is the error:

The field, constructor or member 'Contains' is not defined

What am I missing? I've got other examples to work.

هل كانت مفيدة؟

المحلول

I needed to have the System.Linq namespace imported.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top