Asp.Net MVC Unique id per request

前端 未结 3 924
醉梦人生
醉梦人生 2021-02-20 00:04

In our MVC 5 site, no session, we need to get/generate a unique ID per request. THhis will be used as an ID for logging all activity in the request.

Is there a way to as

3条回答
  •  遇见更好的自我
    2021-02-20 01:07

    Add it to the request item collection odetocode.com/articles/111.aspx

    Guid.NewGuid()
    

    Will generate a unique id.

    http://msdn.microsoft.com/en-us/library/system.guid.newguid(v=vs.110).aspx

提交回复
热议问题