I'm very new to ASP.Core. We have a project and we must use Dependency Injection and StructureMap. I'm wondering if it is the right way to put the Container in the StartUp.cs file in the following method. And if it is safe to put the IHttpContextAccessor in the configuration like below:
public void ConfigureServices(IServiceCollection services) {
Container container = new Container(expr => {
expr.For<IDataContextService>().Use<DataContextService>();
expr.For<IHttpContextAccessor>().Use<HttpContextAccessor>();
expr.For<ISessionService>().Use<SessionService>();
});
services.AddSingleton<IContainer>(container);
}