Example #1
0
 /// <summary>
 /// Creates an instance of <see cref="RegisterCollectionMiddleware{TBootstrapper,TService}"/>
 /// </summary>
 /// <param name="options"></param>
 public RegisterCollectionMiddleware(AssemblyOptions options = null)
 {
     _options = options;
 }
Example #2
0
 internal static IEnumerable <Assembly> GetAssemblies(this IEnumerable <Assembly> assemblies, AssemblyOptions options)
 {
     options = options ?? new AssemblyOptions();
     if (options.IncludeAll == false)
     {
         if (options.IncludedPrefixes.Length > 0)
         {
             assemblies = assemblies.Where(t => options.IncludedPrefixes.Any(p => t.FullName.StartsWith(p)));
         }
         if (options.ExcludedPrefixes.Length > 0)
         {
             assemblies = assemblies.Where(t =>
                                           options.ExcludedPrefixes.All(p => t.FullName.StartsWith(p) == false));
         }
     }
     return(assemblies);
 }