Use AddHttpContextAccessor

pull/301/head
Halil ibrahim Kalkan 8 years ago
parent 4b4531366d
commit 5fb9fc6dab

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection;
@ -93,7 +92,6 @@ namespace Volo.Abp.AspNetCore.Mvc
//TODO: AddViewLocalization by default..?
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();
//Use DI to create controllers

@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore
private static void AddAspNetServices(IServiceCollection services)
{
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddHttpContextAccessor();
}
}
}

Loading…
Cancel
Save