相关疑难解决方法(0)

在元组之后但在另一种类型之前的冒号意味着在方法签名中是什么意思?

在元组之后但在另一种类型之前定位的冒号在方法签名中意味着什么?

这是语法:

member this.Post (portalId : string, req : PushRequestDtr) : IHttpActionResult =
Run Code Online (Sandbox Code Playgroud)

这是上下文:

type PushController (imp) =
    inherit ApiController ()

    member this.Post (portalId : string, req : PushRequestDtr) : IHttpActionResult =
        match imp req with
        | Success () -> this.Ok () :> _
        | Failure (ValidationFailure msg) -> this.BadRequest msg :> _
        | Failure (IntegrationFailure msg) ->
            this.InternalServerError (InvalidOperationException msg) :> _
Run Code Online (Sandbox Code Playgroud)

具体来说,这种方法签名是什么意思?

此方法是采用两个参数还是一个参数?

我理解这个:

(portalId : string, req : PushRequestDtr)
Run Code Online (Sandbox Code Playgroud)

但是我对这个附加在它结尾的语法感到困惑:

: IHttpActionResult
Run Code Online (Sandbox Code Playgroud)

f#

3
推荐指数
1
解决办法
92
查看次数

标签 统计

f# ×1