public void Bind <TInterface>(Action <DependencyOption> option)
        {
            DependencyOption dependencyOption = new DependencyOption();

            option(dependencyOption);

            BindType <TInterface>(_services, dependencyOption.serviceLifetime, dependencyOption.namespaceStr);
        }
        public void AutoBind(Action <DependencyOption> option = null)
        {
            string nameSpaceStr = null;

            if (option != null)
            {
                DependencyOption dependencyOption = new DependencyOption();
                option(dependencyOption);
                nameSpaceStr = dependencyOption.namespaceStr;
            }

            BindType <ITransientType>(_services, ServiceLifetime.Transient, nameSpaceStr);
            BindType <IScopedType>(_services, ServiceLifetime.Scoped, nameSpaceStr);
            BindType <ISingletonType>(_services, ServiceLifetime.Singleton, nameSpaceStr);
        }
        public void Bind <TInterface, TConcrete>(Action <DependencyOption> option)
        {
            DependencyOption dependencyOption = new DependencyOption();

            option(dependencyOption);

            var descriptor = new ServiceDescriptor(typeof(TInterface), typeof(TConcrete), dependencyOption.serviceLifetime);

            var oldDescription = _services.FirstOrDefault(t => t.ServiceType.Equals(typeof(TInterface)));

            if (oldDescription != null)
            {
                _services.Remove(oldDescription);
            }

            var oldDescriptionImp = _services.FirstOrDefault(t => t.ImplementationType.Equals(typeof(TConcrete)));

            if (oldDescriptionImp != null)
            {
                _services.Remove(oldDescriptionImp);
            }

            _services.Add(descriptor);
        }