[英]I got this msg while using F# query expression : error FS0039: Undefined value or constructor “query”
let q = <@ seq {
for i in [1..10] do
yield i
} |> Seq.head @>
q |> query |> ignore //error FS0039
I'am using VS2012 and F# core of "ReferenceAssemblies\\Microsoft\\FSharp\\3.0\\Runtime\\v2.0\\FSharp.Core.dll"
(version 2.3.0.0) on .NET 3.5 ; 我在.NET 3.5上使用
"ReferenceAssemblies\\Microsoft\\FSharp\\3.0\\Runtime\\v2.0\\FSharp.Core.dll"
(2.3.0.0版)的VS2012和F#核心;
What did I miss here? 我在这里想念什么?
I might be wrong (the versioning is a bit confusing) but if you're using F# 3.0 in Visual Studio 2012, then you should be able to use the new query expression syntax instead: 我可能是错的(版本控制有些混乱),但是如果您在Visual Studio 2012中使用F#3.0,则应该可以使用新的查询表达式语法:
query { for i in 1 .. 10 do
select i
head }
This works both in memory and for SQL databases (as well as some type providers). 这既适用于内存,也适用于SQL数据库(以及某些类型提供程序)。 For more information, see the MSDN documentation .
有关更多信息,请参见MSDN文档 。 If you're using older version (or target framework), then I'd definitely recommend upgrading - the F# 3.0 queries are much more solid and easy to use.
如果您使用的是旧版本(或目标框架),那么我绝对会建议您进行升级-F#3.0查询更加扎实和易于使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.