Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Created November 12, 2015 00:55
Show Gist options
  • Save tugberkugurlu/5cfe8607f72a11b08521 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/5cfe8607f72a11b08521 to your computer and use it in GitHub Desktop.
services.AddScoped<FoursquareContext>(provider =>
{
var bonVoyageContext = provider.GetService<BonVoyageContext>();
var httpContextAccessor = provider.GetService<IHttpContextAccessor>();
var accessToken = httpContextAccessor.HttpContext.User.FindFirstValue("access_token");
return bonVoyageContext.CreateFoursquareContext(accessToken);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment