So i have an windows service application and want to start porting it to .NET Core. The application is long running with use of sockets,self hosted mvc, timers etc. I am planning to convert the application to .NET core in order to be able to run it on Windows/Linux etc. The question is what is correct way to implement the service code ? For example i will need to have a web host that serves MVC/API plus the actual service implementation that handles sockets,events etc. I found that currently the way to go is to inherit the service code class from BackgroundService https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.backgroundservice?view=aspnetcore-3.0 So the question is whether BackgroundService is what i should be looking at or is there another more appropriate way?
Thanks.