-
Looking at the SMTP controllers and noticed old things needing to get replaced with the new. I was trying to utilize some of what it recommends. I am wondering how I may be able to help cleanup some of these things. I know @ahoefling had recommended treating the warnings as errors. Wouldn't this be one of them here? And if so I wish to learn how I can help resolve these issues for the platform. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
@thabaum one thing to be aware of with SMTP specifically is that there's a pending pull request #3969 to adjust a lot of that code and move it into a provider. So I check to make sure whatever you're working with isn't about to be changed anyway (you should be good to adjust the Persona Bar pieces, but the core pieces will be shifting around). |
Beta Was this translation helpful? Give feedback.
-
For these deprecations where we're moving from public class ServerSettingsSmtpHostController : PersonaBarApiController
{
private readonly IHostSettingsService hostSettingsService;
public ServerSettingsSmtpHostController(IHostSettingsService hostSettingsService)
{
this.hostSettingsService = hostSettingsService;
}
} You can then replace |
Beta Was this translation helpful? Give feedback.
-
Great thanks, I think that clears it up a lot. These marked for obsolete I presume they all have the I will give it a go in an area that is not worked on much first... |
Beta Was this translation helpful? Give feedback.
For these deprecations where we're moving from
Whatever.Instance
toIWhatever
, to resolve the warning you need to start retrieving the interface via dependency injection. Exactly how you do that will depend a lot on which part of the code you're in. If you're looking at a Web API controller (e.g. in the Persona Bar code), you can just add an additional constructor dependency and DI will fill it in automatically. For instance,