//dfd
        public IServiceProvider Registerdependencies(IServiceCollection services, ITypeFinder typeFinder)
        {
            var containbuilder = new ContainerBuilder();

            containbuilder.RegisterInstance(this).As <IMainEngine>().SingleInstance();
            containbuilder.RegisterInstance(typeFinder).As <ITypeFinder>().SingleInstance();
            // find registrar depen
            var dependencyReg = typeFinder.FindClassesoftype <IDependencyRegistrar>();

            var Instance = dependencyReg
                           .Select(depgk => (IDependencyRegistrar)Activator.CreateInstance(depgk));

            foreach (var chalsolve in Instance)
            {
                chalsolve.Registrar(containbuilder, typeFinder);
            }
            containbuilder.Populate(services);

            ServiceProvider = new AutofacServiceProvider(containbuilder.Build());
            return(ServiceProvider);
            //var contanbuilder = new ContainerBuilder();
            //contanbuilder.RegisterInstance(this).As<IMainEngine>().SingleInstance();
            //contanbuilder.RegisterInstance(typeFinder).As<ITypeFinder>().SingleInstance();
            //var Makedep = typeFinder.FindClassesoftype<IDependencyRegistrar>();
        }