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
36
37
38
39
40
  1. namespace ContosoFlowers
  2. {
  3. using System.Web.Http;
  4. using System.Web.Mvc;
  5. using System.Web.Routing;
  6. using Autofac;
  7. using Autofac.Integration.Mvc;
  8. using AutoMapper;
  9. using Microsoft.Bot.Builder.Dialogs;
  10. using Microsoft.Bot.Builder.Internals.Fibers;
  11. public class WebApiApplication : System.Web.HttpApplication
  12. {
  13. protected void Application_Start()
  14. {
  15. this.RegisterBotDependencies();
  16. Mapper.Initialize(cfg => cfg.CreateMap<Models.Order, Services.Models.Order>());
  17. GlobalConfiguration.Configure(WebApiConfig.Register);
  18. FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
  19. RouteConfig.RegisterRoutes(RouteTable.Routes);
  20. }
  21. private void RegisterBotDependencies()
  22. {
  23. var builder = new ContainerBuilder();
  24. builder.RegisterModule(new ReflectionSurrogateModule());
  25. builder.RegisterModule<ContosoFlowersModule>();
  26. builder.RegisterControllers(typeof(WebApiApplication).Assembly);
  27. builder.Update(Conversation.Container);
  28. DependencyResolver.SetResolver(new AutofacDependencyResolver(Conversation.Container));
  29. }
  30. }
  31. }
Tip!

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

Comments

Loading...