📜  注册所有服务 microsoft .net 核心依赖注入容器 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:00.810000             🧑  作者: Mango

代码示例1
service.RegisterAssemblyPublicNonGenericClasses(… your assembly ref goes here …)
.Where(x => x.Name.EndsWith(“Service”))  //optional
.IgnoreThisInterface()     //optional
.AsPublicImplementedInterfaces(ServiceLifetime.Scoped);