From eb11da0d965071c1eefc81e2f75bc5eeea5acf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Wed, 24 Apr 2024 13:14:51 +0800 Subject: [PATCH] mege --- SlnMesnac.Ioc/DependencyConfigurator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SlnMesnac.Ioc/DependencyConfigurator.cs b/SlnMesnac.Ioc/DependencyConfigurator.cs index 0a5c76c..ff2844f 100644 --- a/SlnMesnac.Ioc/DependencyConfigurator.cs +++ b/SlnMesnac.Ioc/DependencyConfigurator.cs @@ -72,7 +72,7 @@ namespace SlnMesnac.Ioc { //自动注入仓储层的接口实现类 var types = assembly.GetTypes() - .Where(t => t.IsClass && !t.IsAbstract && !t.IsGenericType) + .Where(t => t.IsClass && t is { IsAbstract: false, IsGenericType: false }) .ToList(); foreach (var type in types) @@ -125,7 +125,7 @@ namespace SlnMesnac.Ioc private static void RegisterTypeTransient(ContainerBuilder builder, Assembly assembly) { var types = assembly.GetTypes() - .Where(t => t.IsClass && !t.IsAbstract && !t.IsGenericType) + .Where(t => t.IsClass && t is { IsAbstract: false, IsGenericType: false }) .ToList(); foreach (var type in types)