AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); We inject IHttpContextAccessor to _SecureLayout.cshtml, as shown in Listing 6-30.
確定! 回上一頁