forked from OfficeDev/microsoft-teams-sample-complete-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobal.asax.cs
30 lines (27 loc) · 1013 Bytes
/
Global.asax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Autofac;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Internals;
using Microsoft.Bot.Connector;
using System.Web.Http;
namespace Microsoft.Teams.TemplateBotCSharp
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
// Use an in-memory store for bot data.
// This registers a IBotDataStore singleton that will be used throughout the app.
var store = new InMemoryDataStore();
Conversation.UpdateContainer(builder =>
{
builder.Register(c => new CachingBotDataStore(store,
CachingBotDataStoreConsistencyPolicy
.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
});
}
}
}