在元组之后但在另一种类型之前定位的冒号在方法签名中意味着什么?
这是语法:
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# ×1