public void ConfigureServices()

in App/src/Events-TenantUserApp/Startup.cs [71:102]


        public void ConfigureServices(IServiceCollection services)
        {
            //Localisation settings
            services.AddLocalization(options => options.ResourcesPath = "Resources");

            // Add framework services.
            services.AddMvc()
                .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix)
                .AddDataAnnotationsLocalization();

            // Adds a default in-memory implementation of IDistributedCache.
            services.AddDistributedMemoryCache();
            services.AddSession();

            //register catalog DB
            services.AddDbContext<CatalogDbContext>(options => options.UseSqlServer(GetCatalogConnectionString(CatalogConfig, DatabaseConfig)));

            //Add Application services
            services.AddTransient<ICatalogRepository, CatalogRepository>();
            services.AddTransient<ITenantRepository, TenantRepository>();
            services.AddSingleton<ITenantRepository>(p => new TenantRepository(GetBasicSqlConnectionString()));
            services.AddSingleton<IConfiguration>(Configuration);
            services.AddSingleton<ILookupClient>(p => new LookupClient());

            //create instance of utilities class
            services.AddTransient<IUtilities, Utilities>();
            var provider = services.BuildServiceProvider();
            _utilities = provider.GetService<IUtilities>();
            _catalogRepository = provider.GetService<ICatalogRepository>();
            _tenantRepository = provider.GetService<ITenantRepository>();
            _client = provider.GetService<ILookupClient>();
        }