/// <summary>
        ///     Auto scan and register implementation of service follow
        ///     <see cref="Elect.DI.Attributes" /> life time setup.
        /// </summary>
        public static IServiceCollection AddElectDI(this IServiceCollection services, [NotNull] Action <CvDIOptions> configure)
        {
            services.Configure(configure);

            CvDIOptions options = configure.GetValue();

            var scanner = new Scanner();

            foreach (var assemblyName in options.ListAssemblyName)
            {
                var rootAssemblyName = assemblyName.Split('.').FirstOrDefault();

                foreach (var assemblyFolderPath in options.ListAssemblyFolderPath)
                {
                    // dll files
                    scanner.RegisterAssemblies(services, assemblyFolderPath, $"{rootAssemblyName}.dll");

                    // dll prefix files
                    scanner.RegisterAssemblies(services, assemblyFolderPath, $"{rootAssemblyName}.*.dll");
                }
            }

            return(services);
        }
 /// <summary>
 ///     Auto scan and register implementation of service follow
 ///     <see cref="Elect.DI.Attributes" /> life time setup.
 /// </summary>
 public static IServiceCollection AddElectDI(this IServiceCollection services, [NotNull] CvDIOptions configure)
 {
     return(services.AddElectDI(_ =>
     {
         _.ListAssemblyFolderPath = configure.ListAssemblyFolderPath;
         _.ListAssemblyName = configure.ListAssemblyName;
     }));
 }