Skip to content

Instantly share code, notes, and snippets.

@wellingtonjhn
Created April 30, 2018 01:08
Show Gist options
  • Select an option

  • Save wellingtonjhn/c1d158376291764a6efa82553f33aa0a to your computer and use it in GitHub Desktop.

Select an option

Save wellingtonjhn/c1d158376291764a6efa82553f33aa0a to your computer and use it in GitHub Desktop.
HttpcontextAccessor DI
public void ConfigureServices(IServiceCollection services)
{
// ... restante do método ocultado
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddScoped<AuthenticatedUser>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment