You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
672 B

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Znyc.Cloudcar.Admin.Commons.Helpers;
namespace Znyc.Cloudcar.Admin.Commons.Extensions
{
/// <summary>
/// HttpContext 扩展
/// </summary>
public static class HttpContextExtentions
{
public static IApplicationBuilder UseStaticHttpContextAccessor(this IApplicationBuilder app)
{
IHttpContextAccessor httpContextAccessor = app.ApplicationServices.GetRequiredService<IHttpContextAccessor>();
HttpContextHelper.Configure(httpContextAccessor);
return app;
}
}
}