Browse Source

增加 IHttpContextAccessor 的获取,暂不启用。

master
Elivo 4 weeks ago
parent
commit
703cff6a76
  1. 8
      Apewer.Web/Web/AspNetCoreStartup.cs

8
Apewer.Web/Web/AspNetCoreStartup.cs

@ -39,6 +39,8 @@ namespace Apewer.Web
/// <summary>限制请求体的字节数,默认值:1073741824(1GB)。</summary>
public virtual long MaxRequestBodySize { get => 1073741824L; }
// public virtual void IHttpContextAccessor(IHttpContextAccessor accessor) { }
#region Runtime
bool _usedWebSocket = false;
@ -88,6 +90,12 @@ namespace Apewer.Web
});
}
// var serviceProvider = services.BuildServiceProvider();
// if (serviceProvider != null)
// {
// IHttpContextAccessor(serviceProvider.GetRequiredService<IHttpContextAccessor>());
// }
services.AddControllers();
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
}

Loading…
Cancel
Save