处理 Exists
#r @"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Linq.dll";;
#r @"E:\Projects\F#3\FSharp.Data.TypeProviders.dll";;
open Microsoft.FSharp.Data.TypeProviders;;
[<Generate>]
type T0 = SqlDataConnection<"Data Source=.\SQLEXPRESS;Initial Catalog=FSharpSample;User ID=sa;Password=FSharpSample1234">
let TypeProvider3 () =
let db = T0.GetDataContext();
let q = query {
for s in db.Student do
where (query {for c in db.CourseSelection do exists (c.StudentID = 1)})
select s
}
q |> Seq.iter (fun n -> printfn "%A" n.Name)