Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
F# 无财产';HasValue';ODataService类型提供程序的可为null的int存在_F#_Type Providers_F# 3.0 - Fatal编程技术网

F# 无财产';HasValue';ODataService类型提供程序的可为null的int存在

F# 无财产';HasValue';ODataService类型提供程序的可为null的int存在,f#,type-providers,f#-3.0,F#,Type Providers,F# 3.0,我正在尝试使用Netflix的ODataService类型提供程序。这很好: type internal NetflixData = ODataService<"http://odata.netflix.com/Catalog/"> let internal NetflixContext = NetflixData.GetDataContext() let godzillamovies = query { for t in NetflixContext.Titles do

我正在尝试使用Netflix的ODataService类型提供程序。这很好:

type internal NetflixData = ODataService<"http://odata.netflix.com/Catalog/">
let internal NetflixContext = NetflixData.GetDataContext()

let godzillamovies = query { for t in NetflixContext.Titles do 
                             where (t.Name.Contains "Godzilla")
                             select (t.Name, t.ReleaseYear)
                           } |> Seq.toList
我遇到了以下错误:

<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>
<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">
  <code></code>
  <message xml:lang=\"en-US\">No property 'HasValue' exists in type 'System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' at position 45.</message>
</error>
HasValue对于可为null的整数不存在?自从何时?

#r“FSharp.Data.TypeProviders”
#r "FSharp.Data.TypeProviders"
#r "System.Data.Services.Client"

open Microsoft.FSharp.Data.TypeProviders
open Microsoft.FSharp.Linq.NullableOperators

type internal NetflixData = ODataService<"http://odata.netflix.com/Catalog/">
let internal NetflixContext = NetflixData.GetDataContext()

NetflixContext.DataContext.SendingRequest.Add(fun e -> printfn "%A" e.Request.RequestUri)

// http://odata.netflix.com/Catalog/Titles()?$filter=substringof('Godzilla',Name) and (ReleaseYear ne null)&$select=Name,ReleaseYear
let godzillamovies = query { for t in NetflixContext.Titles do 
                             where (t.Name.Contains "Godzilla")
                             where (t.ReleaseYear ?<>? System.Nullable())
                             select (t.Name, t.ReleaseYear)
                           } |> Seq.toList
#r“系统、数据、服务、客户端” 打开Microsoft.FSharp.Data.TypeProviders 打开Microsoft.FSharp.Linq.NullableOperators 键入内部NetflixData=ODataService 让内部NetflixContext=NetflixData.GetDataContext() NetflixContext.DataContext.SendingRequest.Add(趣味e->printfn“%A”e.Request.RequestUri) // http://odata.netflix.com/Catalog/Titles()?$filter=substringof('Godzilla',Name)和(ReleaseYear ne null)&$select=Name,ReleaseYear 让godzillamovies=query{for NetflixContext.Titles中的t 其中(t.Name.Contains“哥斯拉”) 其中(t.ReleaseYear??System.Nullable()) 选择(t.Name,t.ReleaseYear) }|>顺序列表
我不得不将选择切换到
select(t.Name,t.ReleaseYear.Value)
但是很好,谢谢。
#r "FSharp.Data.TypeProviders"
#r "System.Data.Services.Client"

open Microsoft.FSharp.Data.TypeProviders
open Microsoft.FSharp.Linq.NullableOperators

type internal NetflixData = ODataService<"http://odata.netflix.com/Catalog/">
let internal NetflixContext = NetflixData.GetDataContext()

NetflixContext.DataContext.SendingRequest.Add(fun e -> printfn "%A" e.Request.RequestUri)

// http://odata.netflix.com/Catalog/Titles()?$filter=substringof('Godzilla',Name) and (ReleaseYear ne null)&$select=Name,ReleaseYear
let godzillamovies = query { for t in NetflixContext.Titles do 
                             where (t.Name.Contains "Godzilla")
                             where (t.ReleaseYear ?<>? System.Nullable())
                             select (t.Name, t.ReleaseYear)
                           } |> Seq.toList