Last active
November 19, 2018 23:57
-
-
Save jamesmundy/f54a3121858ed0524182975dcea791d3 to your computer and use it in GitHub Desktop.
Register Bot Framework Dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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