Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Global.asax.cs 1.2 KB

You have to be logged in to leave a comment. Sign In
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
31
32
33
34
35
  1. namespace CustomStateBot
  2. {
  3. using System;
  4. using System.Configuration;
  5. using System.Reflection;
  6. using System.Web.Http;
  7. using Autofac;
  8. using Microsoft.Bot.Builder.Azure;
  9. using Microsoft.Bot.Builder.Dialogs;
  10. using Microsoft.Bot.Builder.Dialogs.Internals;
  11. using Microsoft.Bot.Connector;
  12. public class WebApiApplication : System.Web.HttpApplication
  13. {
  14. protected void Application_Start()
  15. {
  16. Uri docDbServiceEndpoint = new Uri(ConfigurationManager.AppSettings["DocumentDbServiceEndpoint"]);
  17. string docDbEmulatorKey = ConfigurationManager.AppSettings["DocumentDbAuthKey"];
  18. var builder = new ContainerBuilder();
  19. builder.RegisterModule(new AzureModule(Assembly.GetExecutingAssembly()));
  20. var store = new DocumentDbBotDataStore(docDbServiceEndpoint, docDbEmulatorKey);
  21. builder.Register(c => store)
  22. .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
  23. .AsSelf()
  24. .SingleInstance();
  25. builder.Update(Conversation.Container);
  26. GlobalConfiguration.Configure(WebApiConfig.Register);
  27. }
  28. }
  29. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...