From 09b58274fe9935de3c13660f4adf30d4ea3b2d77 Mon Sep 17 00:00:00 2001 From: Pablo Costantini Date: Tue, 13 Jun 2017 16:21:55 -0300 Subject: [PATCH] Replace ContainerBuilder.Update with Conversation.UpdateContainer --- .../ContosoFlowers/Global.asax.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CSharp/demo-ContosoFlowers/ContosoFlowers/Global.asax.cs b/CSharp/demo-ContosoFlowers/ContosoFlowers/Global.asax.cs index ecd5960618..91428f544a 100644 --- a/CSharp/demo-ContosoFlowers/ContosoFlowers/Global.asax.cs +++ b/CSharp/demo-ContosoFlowers/ContosoFlowers/Global.asax.cs @@ -24,15 +24,12 @@ protected void Application_Start() private void RegisterBotDependencies() { - var builder = new ContainerBuilder(); - - builder.RegisterModule(new ReflectionSurrogateModule()); - - builder.RegisterModule(); - - builder.RegisterControllers(typeof(WebApiApplication).Assembly); - - builder.Update(Conversation.Container); + Conversation.UpdateContainer(builder => + { + builder.RegisterModule(new ReflectionSurrogateModule()); + builder.RegisterModule(); + builder.RegisterControllers(typeof(WebApiApplication).Assembly); + }); DependencyResolver.SetResolver(new AutofacDependencyResolver(Conversation.Container)); }