Skip to content

Instantly share code, notes, and snippets.

@jamesmundy
Last active November 19, 2018 23:57
Show Gist options
  • Save jamesmundy/f54a3121858ed0524182975dcea791d3 to your computer and use it in GitHub Desktop.
Save jamesmundy/f54a3121858ed0524182975dcea791d3 to your computer and use it in GitHub Desktop.
Register Bot Framework Dependencies
private static void RegisterDependencies(IAppSettingsService settingsService)
{
var store = new TableBotDataStore(settingsService.StorageConnectionString);
Conversation.UpdateContainer(builder =>
{
builder.RegisterModule(new DefaultExceptionMessageOverrideModule());
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store, CachingBotDataStoreConsistencyPolicy.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.SingleInstance();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment