Sandcastle - 结合RoutePrefix和Route来获取完整的URI

时间:2017-02-03 15:11:15

标签: c# attributes asp.net-web-api2 documentation-generation shfb

我正在使用Sandcastle帮助文件生成器来记录API。我希望自动化尽可能多的过程,不仅可以让开发人员在添加新路由时更容易,还可以更新文档。到目前为止我的评论是这样的:

[Authorize]
[HasAction(Actions = "POS")]
[RoutePrefix("api/Command/POS")]
public class CmdPOSController : ApiController {
    ///<summary>API to create new payments from point of sale.</summary>
    ///<param name="json">{amount, confirmationNumber, paymentType}</param>
    ///<returns>Original JSON object is returned.</returns>
    [HttpPost]
    [Route("Payments/Create")]
    public dynamic CreatePayment([FromBody] JToken json) {

我的问题是,有没有办法获得每条API路线的完整路线?

0 个答案:

没有答案