We will be using dependency injection in this project. We will be using a library called Autofac to do so. Autofac is an open source inversion of control (IoC) container. We will create a Resolver class in order to easily resolve types that we will add to the container later in this chapter. To do so, go through the following steps:
- Install Autofac from NuGet in the MeTracker, MeTracker.Android, and MeTracker.iOS projects.
- In the MeTracker project, create a new class called Resolver in the root of the project.
- Create a private static IContainer field called container.
- Create a static method called Initialized that has an IContainer argument. Set the value of the container field, as follows:
using Autofac;
using System;
using System.Collections.Generic;
using System.Text;
namespace MeTracker
{
public class Resolver
{
private static IContainer container;
...