[英]How to get id from paths in Grapevine
這是一個簡單的問題,但我沒有找到任何文檔。 葡萄藤4.2.2
//GET id
[RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "/api/[id]")]
public IHttpContext GetDataId(IHttpContext context)
{
//how to get id?
}
一旦你寫了一個問題,就會出現這種情況,答案就會出現。
//GET id
[RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "/api/[id]")]
public IHttpContext GetDataId(IHttpContext context)
{
var id = context.Request.PathParameters["id"];
}
https://gist.github.com/scottoffen/af9cac93dd1c26440690d9a768ca1117
為什么 Grapevine 沒有正常的文檔?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.