The AddControllerActivation method registers controllers with the transient lifestyle. This typically works well, but leads to complications whenever users decide to implement IDisposable on them. Registering controllers as Scoped lead to difficulties under Simple Injector v4, but in v5 the standard Lifestyle Mismatch behavior has been loosened, making is possible for Scoped components to depend on Transient.
Adding an AddControllerActivation(Lifestyle) overload would, therefore, make life easier for those developers.
The
AddControllerActivation
method registers controllers with the transient lifestyle. This typically works well, but leads to complications whenever users decide to implementIDisposable
on them. Registering controllers asScoped
lead to difficulties under Simple Injector v4, but in v5 the standard Lifestyle Mismatch behavior has been loosened, making is possible for Scoped components to depend on Transient.Adding an
AddControllerActivation(Lifestyle)
overload would, therefore, make life easier for those developers.