public static IServiceCollection AddRepositories(this IServiceCollection services)
        {
            IRepositoryFactory repoFactory = services.BuildServiceProvider().GetService <IRepositoryFactory>();

            if (repoFactory == null)
            {
                throw new DataAccessResolveException("IRepositoryFactory must be resolved before repositories!");
            }

            services.AddTransient(provider => repoFactory.CreateCustomersRepository());

            return(services);
        }