You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
461 B
C#
21 lines
461 B
C#
using Microsoft.AspNetCore.Http;
|
|
|
|
namespace Admin.Core.Serilog.Es
|
|
{
|
|
public static class HttpContextProvider
|
|
{
|
|
private static IHttpContextAccessor _accessor;
|
|
|
|
public static HttpContext GetCurrent()
|
|
{
|
|
var context = _accessor?.HttpContext;
|
|
return context;
|
|
}
|
|
public static void ConfigureAccessor(IHttpContextAccessor accessor)
|
|
{
|
|
_accessor = accessor;
|
|
}
|
|
}
|
|
|
|
}
|