In F# how can I produce an expression with a type of Func?

前端 未结 3 663
孤街浪徒
孤街浪徒 2021-02-12 22:38

I\'m working with an api that requires a value of type Func. (Specifically, I\'m trying to call ModelMetadataProviders.Current.GetMetadataForType().

How can I construct

3条回答
  •  一向
    一向 (楼主)
    2021-02-12 22:57

    let f = new System.Func(fun() -> printfn "ok"; new obj())
    

提交回复
热议问题