Browse Source

Refine type filtering in ConventionalRegistrarBase

pull/23723/head
maliming 5 months ago
parent
commit
1394fd59c7
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 13
      framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ConventionalRegistrarBase.cs

13
framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ConventionalRegistrarBase.cs

@ -19,16 +19,15 @@ public abstract class ConventionalRegistrarBase : IConventionalRegistrar
{
types = AssemblyHelper
.GetAllTypes(assembly)
.Where(
type => type != null &&
type.IsClass &&
!type.IsAbstract &&
!type.IsGenericType
).ToArray();
.Where(type => type != null && type.IsClass && !type.IsAbstract && !type.IsGenericType)
.ToArray();
}
catch (ReflectionTypeLoadException e)
{
types = e.Types.Select(x => x!).ToArray();
types = e.Types
.Where(type => type != null && type.IsClass && !type.IsAbstract && !type.IsGenericType)
.Select(x => x!)
.ToArray();
logger.LogException(e);
}
catch (Exception e)

Loading…
Cancel
Save