private static IServiceProvider GetServiceProvider(IAntiforgeryContextAccessor contextAccessor) { var serviceCollection = new ServiceCollection(); serviceCollection.AddInstance <IAntiforgeryContextAccessor>(contextAccessor); return(serviceCollection.BuildServiceProvider()); }
private static IServiceProvider GetServiceProvider(IAntiforgeryContextAccessor contextAccessor) { var serviceCollection = new ServiceCollection(); serviceCollection.AddInstance<IAntiforgeryContextAccessor>(contextAccessor); return serviceCollection.BuildServiceProvider(); }