Here, we will create a Bootstrapper class so that we can set up the common configurations that we need in the startup phase of the app. Usually, there is one part of the Bootstrapper class for each target platform and one that is shared for all platforms. In this project, we only need the shared part:
- Create a new class called Bootstrapper in the Chat project.
- Add a new public static method called Init.
- Create a new ContainerBuilder and register the types to container.
- Create a Container using the Build method of ContainerBuilder. Create a variable called container that contains the Container instance.
- Use the Initialize method on Resolver and pass the container variable as an argument, as shown in the following code:
using Autofac;
using Chat.Chat;
using System;
using System.Reflection;
public class Bootstrapper
{
public static...