c# - Default project dependency disposing inconsistency -
after creating new asp.net core project in visual studio 2017 2 controllers: accountcontroller
, managecontroller
. both controllers use dependency injection via constructors applicationsigninmanager
, applicationusermanager
.
accountcontroller
's dispose
:
protected override void dispose(bool disposing) { if (disposing) { if (_usermanager != null) { _usermanager.dispose(); _usermanager = null; } if (_signinmanager != null) { _signinmanager.dispose(); _signinmanager = null; } } base.dispose(disposing); }
managecontroller
's dispose
:
protected override void dispose(bool disposing) { if (disposing && _usermanager != null) { _usermanager.dispose(); _usermanager = null; } base.dispose(disposing); }
why doesn't managecontroller
dispose sign in manager? why different accountcontroller
?
based on juan's comment:
it looks oversight, doesn't matter because ioc container should dispose dependencies it's fine remove dispose methods altogether.
Comments
Post a Comment