Skip to content

Commit

Permalink
Update AutofacPropertityModuleReg.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoy8 committed Dec 16, 2023
1 parent 1be389a commit 3eb3316
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Blog.Core.Api/Filter/AutofacPropertityModuleReg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class AutofacPropertityModuleReg : Autofac.Module
{
protected override void Load(ContainerBuilder builder)
{
// 记得要启动服务注册
// builder.Services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
var controllerBaseType = typeof(ControllerBase);
builder.RegisterAssemblyTypes(typeof(Program).Assembly)
.Where(t => controllerBaseType.IsAssignableFrom(t) && t != controllerBaseType)
Expand Down

0 comments on commit 3eb3316

Please sign in to comment.