Beispiel #1
0
        public static List <Assembly> GetAssemblies(Assembly assemblyPar = null)
        {
            var assembly = assemblyPar ?? Assembly.GetEntryAssembly();

            var assemblyNames = new List <string>
            {
                $".Dominio.",
            };

            return(FilesAssembly
                   .GetAssemblies(assembly, (x) => assemblyNames.Any(n => x.Contains(n)))
                   );
        }
Beispiel #2
0
        public static bool IsContemServico(Assembly assemblyPar = null)
        {
            var assembly = assemblyPar ?? Assembly.GetEntryAssembly();

            var assemblyProjeto = assembly.FullName.GetLista('.').GetValue(0);

            var assemblyNames = new List <string>
            {
                $"{assemblyProjeto}.Servico"
            };

            return(FilesAssembly
                   .GetAssemblies(assembly, (x) => assemblyNames.Any(n => x.Contains(n)))
                   .Any()
                   );
        }
Beispiel #3
0
        public static void AddInstaller(this IAbstractContainer container)
        {
            ClearAssembly();

            AddAssembly(Assembly.GetCallingAssembly());
            AddAssembly(Assembly.GetEntryAssembly());
            AddAssembly(Assembly.GetExecutingAssembly());

            FilesAssembly
            .GetAssemblies(null, (x) => IsContainName(x) && !IsContainLocation(x))
            .ForEach(assembly => AddAssembly(assembly))
            ;

            var assemblies = _assemblies.ToArray();

            foreach (var assembly in assemblies)
            {
                try
                {
                    InstallAssembly(container, assembly);
                }
                catch (Exception ex) { Logger.Debug("erro install", ex: ex); }
            }
        }