简体   繁体   中英

How to get id from paths in Grapevine

Its a simple question, but I haven't found any documentation. Grapevine 4.2.2

        //GET id
        [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "/api/[id]")]
        public IHttpContext GetDataId(IHttpContext context)
        {
            //how to get id?
        }

This happens as soon as you write a question, the answer will appear.

    //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

Why Grapevine dont have a normal documentation?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM