Skip to content

Instantly share code, notes, and snippets.

@ntotten
Created January 26, 2011 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntotten/796884 to your computer and use it in GitHub Desktop.
Save ntotten/796884 to your computer and use it in GitHub Desktop.
public void Application_Start()
{
FacebookContext.SetApplication(new RequestScopedFacebookApplication());
}
private class RequestScopedFacebookApplication : IFacebookApplication
{
private IFacebookApplication Current
{
get
{
var url = HttpContext.Current.Request.Url;
var app = GetSettingsForUrl(url);
return app;
}
}
public string AppId
{
get { return Current.AppId; }
}
public string AppSecret
{
get { return Current.AppSecret; }
}
public string SiteUrl
{
get { return Current.SiteUrl; }
}
public string CanvasPage
{
get { return Current.CanvasPage; }
}
public string CanvasUrl
{
get { return Current.CanvasUrl; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment